diff options
author | Marcin Juszkiewicz <hrw@openembedded.org> | 2007-10-18 11:16:50 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <hrw@openembedded.org> | 2007-10-18 11:16:50 +0000 |
commit | db2c72991c243b6a510cbd751ae6294a8130a4c4 (patch) | |
tree | 86b1d95494c9e9972c520c0c77ecb2e14602b2a3 /contrib/source-checker | |
parent | fe20d17f5d68f0c439852a662efe33f1078f7cdb (diff) | |
parent | adcc4854f728186b90f4d09184a3d9ec5e321b37 (diff) |
merge of '1146b968b17a4186232fbe41a3a6eb7fe30cc300'
and '40ef55d01967050e97ee3727a1e5e15b968e0a92'
Diffstat (limited to 'contrib/source-checker')
-rw-r--r-- | contrib/source-checker/oe-source-checker.py | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/contrib/source-checker/oe-source-checker.py b/contrib/source-checker/oe-source-checker.py index 920ac9cd6c..991139d44d 100644 --- a/contrib/source-checker/oe-source-checker.py +++ b/contrib/source-checker/oe-source-checker.py @@ -36,37 +36,46 @@ # -import sys, ConfigParser +import sys + +if len(sys.argv) < 3: + print """ + OpenEmbedded source checker script require two arguments: + + 1. location of conf/checksums.ini + 2. path to DL_DIR (without "/" at the end) + """ + sys.exit(0) + +import ConfigParser, os checksums_parser = ConfigParser.ConfigParser() checksums_parser.read(sys.argv[1]) for source in checksums_parser.sections(): archive = source.split("/")[-1] - localpath = sys.argv[2] + "/" + archive + localpath = os.path.join(sys.argv[2], archive) md5 = checksums_parser.get(source, "md5") sha = checksums_parser.get(source, "sha256") try: os.stat(localpath) - try: - md5pipe = os.popen('md5sum ' + localpath) - md5data = (md5pipe.readline().split() or [ "" ])[0] - md5pipe.close() - except OSError: - raise Exception("Executing md5sum failed") + except: + continue - try: - shapipe = os.popen("oe_sha256sum " + localpath) - shadata = (shapipe.readline().split() or [ "" ])[0] - shapipe.close() - except OSError: - raise Exception("Executing shasum failed") + try: + md5pipe = os.popen('md5sum ' + localpath) + md5data = (md5pipe.readline().split() or [ "" ])[0] + md5pipe.close() if md5 != md5data: print "%s has wrong md5: %s instead of %s url: %s" % (archive, md5data, md5, source) - if sha != shadata: + shapipe = os.popen("oe_sha256sum " + localpath) + shadata = (shapipe.readline().split() or [ "" ])[0] + shapipe.close() + + if shadata != "" and sha != shadata: print "%s has wrong sha: %s instead of %s url: %s" % (archive, shadata, sha, source) except: pass |