]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/utils.py
Revert "revert all my stupid commits, we'll try this again later when we have a test...
[dak.git] / daklib / utils.py
index 511d7244fee6281bd9b79b085e08be82a140c628..75845244270fc04e554675f831100a9c7b0123e8 100755 (executable)
@@ -220,7 +220,7 @@ def create_hash (lfiles, key, testfn, basedict = None):
             rejmsg.append("Could not open file %s for checksumming" % (f))
 
         # Check hash
-        if basedict:
+        if basedict and basedict.has_key(f):
             basedict[f]['%ssum' % key] = testfn(file_handle)
         file_handle.close()
 
@@ -288,12 +288,11 @@ def ensure_hashes(changes, dsc, files, dsc_files):
     # I hate backwards compatibility
     for h,f,v in known_hashes:
         try:
-            fs = build_file_list(changes, 0, "checksums-%s" % h, h)
             if format < v:
-                for m in create_hash(fs, h, f, files):
+                for m in create_hash(files, h, f, files):
                     rejmsg.append(m)
             else:
-                for m in check_hash(".changes %s" % (h), fs, h, f, files):
+                for m in check_hash(".changes %s" % (h), files, h, f, files):
                     rejmsg.append(m)
         except NoFilesFieldError:
             rejmsg.append("No Checksums-%s: field in .changes" % (h))
@@ -305,12 +304,11 @@ def ensure_hashes(changes, dsc, files, dsc_files):
         if "source" not in changes["architecture"]: continue
 
         try:
-            fs = build_file_list(dsc, 1, "checksums-%s" % h, h)
             if format < v:
-                for m in create_hash(fs, h, f, dsc_files):
+                for m in create_hash(dsc_files, h, f, dsc_files):
                     rejmsg.append(m)
             else:
-                for m in check_hash(".dsc %s" % (h), fs, h, f, dsc_files):
+                for m in check_hash(".dsc %s" % (h), dsc_files, h, f, dsc_files):
                     rejmsg.append(m)
         except UnknownFormatError, format:
             rejmsg.append("%s: unknown format of .dsc" % (format))