X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcheck_archive.py;h=33dc8481bc2aeac659c4e055e7917ebfa06829da;hb=bd78bbf9170cc8ee2dda06a7f060fd3370fea2bd;hp=93cc832c1fb0efd41748e894bf607894a20c9c5f;hpb=d16e2f9f99f018d3672e77f86a3adf264844590f;p=dak.git diff --git a/dak/check_archive.py b/dak/check_archive.py index 93cc832c..33dc8481 100755 --- a/dak/check_archive.py +++ b/dak/check_archive.py @@ -221,11 +221,13 @@ def check_checksums(): # every time we scan the archive. Yet another hack (TM) which can go away # once this is all working if db_sha1sum is not None and db_sha1sum != '': + f.seek(0) sha1sum = apt_pkg.sha1sum(f) if sha1sum != db_sha1sum: utils.warn("**WARNING** sha1sum mismatch for '%s' ('%s' [current] vs. '%s' [db])." % (filename, sha1sum, db_sha1sum)) if db_sha256sum is not None and db_sha256sum != '': + f.seek(0) sha256sum = apt_pkg.sha256sum(f) if sha256sum != db_sha256sum: utils.warn("**WARNING** sha256sum mismatch for '%s' ('%s' [current] vs. '%s' [db])." % (filename, sha256sum, db_sha256sum)) @@ -305,7 +307,7 @@ def validate_sources(suite, component): filename = "%s/dists/%s/%s/source/Sources.gz" % (Cnf["Dir::Root"], suite, component) print "Processing %s..." % (filename) # apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance... - temp_filename = utils.temp_filename() + (fd, temp_filename) = utils.temp_filename() (result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename)) if (result != 0): sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output)) @@ -344,7 +346,7 @@ def validate_packages(suite, component, architecture): % (Cnf["Dir::Root"], suite, component, architecture) print "Processing %s..." % (filename) # apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance... - temp_filename = utils.temp_filename() + (fd, temp_filename) = utils.temp_filename() (result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename)) if (result != 0): sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output))