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:
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)
# 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:
inside_signature = 0
continue
contents += line
- f.close()
+ file.close()
return contents
def display_changes(changes_filename):
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:
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: