Skip to content

Instantly share code, notes, and snippets.

@psftw
Created September 14, 2013 17:29
Show Gist options
  • Save psftw/6563872 to your computer and use it in GitHub Desktop.
Save psftw/6563872 to your computer and use it in GitHub Desktop.
quick hack to verify checksums when moving to new artifactory server, preceded by dependency:copy-dependencies and followed by vimdiff
import os
import os.path as osp
import hashlib
data = []
for path, dirnames, fnames in os.walk('.'):
if path.endswith('art'):
for fname in fnames:
sha1 = hashlib.sha1(open(osp.join(path, fname)).read()).hexdigest()
data.append((fname, sha1))
data = list(set(data))
outfile = open('artifacts.txt', 'w')
for fname, sha1 in sorted(data):
outfile.write('%s %s\n' % (sha1, fname))
outfile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment