X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fexamine_package.py;h=3161428de9919f9563a86752a1cb108cb858831b;hb=cc03060fe1f565dc37fd8db757b4a6973a698f46;hp=d452d71ca64359df7261fae40142c0798aa244df;hpb=1408d82381556c9e2b3eaa04412846c766a011db;p=dak.git diff --git a/dak/examine_package.py b/dak/examine_package.py index d452d71c..3161428d 100755 --- a/dak/examine_package.py +++ b/dak/examine_package.py @@ -398,8 +398,7 @@ def get_copyright (deb_filename): cright = o.read()[:-1] if cright == "": - print_formatted_text("WARNING: No copyright found, please check package manually.") - return + return formatted_text("WARNING: No copyright found, please check package manually.") doc_directory = re_doc_directory.sub(r'\1', cright) if package != doc_directory: @@ -407,16 +406,15 @@ def get_copyright (deb_filename): o = os.popen("dpkg-deb --fsys-tarfile %s | tar xvOf - %s 2>/dev/null" % (deb_filename, cright)) cright = o.read() - crightmd5 = md5.md5(cright).hexdigest() + copyrightmd5 = md5.md5(cright).hexdigest() res = "" - if printed_copyrights.has_key(crightmd5) and printed_copyrights[crightmd5] != "%s (%s)" % (package, deb_filename): - res += formatted_text( "NOTE: Copyright is the same as %s.\n" % \ - (printed_copyrights[crightmd5])) + if printed_copyrights.has_key(copyrightmd5) and printed_copyrights[copyrightmd5] != "%s (%s)" % (package, deb_filename): + res += formatted_text( "NOTE: Copyright is the same as %s.\n\n" % \ + (printed_copyrights[copyrightmd5])) else: - printed_copyrights[crightmd5] = "%s (%s)" % (package, deb_filename) - res += formatted_text(cright) - return res + printed_copyrights[copyrightmd5] = "%s (%s)" % (package, deb_filename) + return res+formatted_text(cright) def check_dsc (dsc_filename): (dsc) = read_changes_or_dsc(dsc_filename) @@ -459,11 +457,11 @@ def check_deb (deb_filename): # Read a file, strip the signature and return the modified contents as # a string. def strip_pgp_signature (filename): - f = daklib.utils.open_file (filename) + file = daklib.utils.open_file (filename) contents = "" inside_signature = 0 skip_next = 0 - for line in f.readlines(): + for line in file.readlines(): if line[:-1] == "": continue if inside_signature: @@ -481,7 +479,7 @@ def strip_pgp_signature (filename): inside_signature = 0 continue contents += line - f.close() + file.close() return contents def display_changes(changes_filename): @@ -531,7 +529,7 @@ def main (): if f.endswith(".changes"): check_changes(f) elif f.endswith(".deb") or f.endswith(".udeb"): - check_deb(f) + check_deb(file) elif f.endswith(".dsc"): check_dsc(f) else: @@ -542,7 +540,7 @@ def main (): less_fd.close() sys.stdout = stdout_fd except IOError, e: - if e.errno == errno.EPIPE: + if errno.errorcode[e.errno] == 'EPIPE': daklib.utils.warn("[examine-package] Caught EPIPE; skipping.") pass else: