+ fs = utils.build_file_list(dsc, 1, "checksums-%s" % h, h)
+ check_hash(".dsc %s" % (h), fs, h, f, dsc_files)
+ except utils.no_files_exc:
+ reject("No Checksums-%s: field in .dsc" % (h))
+ except utils.changes_parse_error_exc, line:
+ reject("parse error for Checksums-%s in .dsc, can't grok: %s." % (h, line))
+
+################################################################################
+
+def check_hash (where, lfiles, key, testfn, basedict = None):
+ if basedict:
+ for f in basedict.keys():
+ if f not in lfiles:
+ reject("%s: no %s checksum" % (f, key))
+
+ for f in lfiles.keys():
+ if basedict and f not in basedict:
+ reject("%s: extraneous entry in %s checksums" % (f, key))
+
+ try:
+ file_handle = utils.open_file(f)
+ except utils.cant_open_exc: