Created
September 14, 2013 17:29
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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