]> git.decadent.org.uk Git - dak.git/commitdiff
pychecker cleanup
authorJoerg Jaspert <joerg@debian.org>
Sat, 3 May 2008 20:42:05 +0000 (22:42 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sat, 3 May 2008 20:42:05 +0000 (22:42 +0200)
ChangeLog
dak/examine_package.py [changed mode: 0644->0755]

index dc39277a75eb289b7fec5a9de88686e1483ae3d0..11ff452c17d5658573ff6bcd862374f09e642120 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-03  Joerg Jaspert  <joerg@debian.org>
+
+       * dak/examine_package.py: clean up pychecker warnings (merged with
+       Thomas changes to the NEW display)
+
 2008-05-03  Mark Hymers <mhy@debian.org>
 
        * dak/check_archive.py: clean up pychecker warnings
old mode 100644 (file)
new mode 100755 (executable)
index b9ac9af..3161428
@@ -395,18 +395,18 @@ def do_lintian (filename):
 def get_copyright (deb_filename):
     package = re_package.sub(r'\1', deb_filename)
     o = os.popen("dpkg-deb -c %s | egrep 'usr(/share)?/doc/[^/]*/copyright' | awk '{print $6}' | head -n 1" % (deb_filename))
-    copyright = o.read()[:-1]
+    cright = o.read()[:-1]
 
-    if copyright == "":
+    if cright == "":
         return formatted_text("WARNING: No copyright found, please check package manually.")
 
-    doc_directory = re_doc_directory.sub(r'\1', copyright)
+    doc_directory = re_doc_directory.sub(r'\1', cright)
     if package != doc_directory:
         return formatted_text("WARNING: wrong doc directory (expected %s, got %s)." % (package, doc_directory))
 
-    o = os.popen("dpkg-deb --fsys-tarfile %s | tar xvOf - %s 2>/dev/null" % (deb_filename, copyright))
-    copyright = o.read()
-    copyrightmd5 = md5.md5(copyright).hexdigest()
+    o = os.popen("dpkg-deb --fsys-tarfile %s | tar xvOf - %s 2>/dev/null" % (deb_filename, cright))
+    cright = o.read()
+    copyrightmd5 = md5.md5(cright).hexdigest()
 
     res = ""
     if printed_copyrights.has_key(copyrightmd5) and printed_copyrights[copyrightmd5] != "%s (%s)" % (package, deb_filename):
@@ -414,7 +414,7 @@ def get_copyright (deb_filename):
                                (printed_copyrights[copyrightmd5]))
     else:
         printed_copyrights[copyrightmd5] = "%s (%s)" % (package, deb_filename)
-    return res+formatted_text(copyright)
+    return res+formatted_text(cright)
 
 def check_dsc (dsc_filename):
     (dsc) = read_changes_or_dsc(dsc_filename)
@@ -491,11 +491,11 @@ def check_changes (changes_filename):
 
     changes = daklib.utils.parse_changes (changes_filename)
     files = daklib.utils.build_file_list(changes)
-    for file in files.keys():
-        if file.endswith(".deb") or file.endswith(".udeb"):
-            check_deb(file)
-        if file.endswith(".dsc"):
-            check_dsc(file)
+    for f in files.keys():
+        if f.endswith(".deb") or f.endswith(".udeb"):
+            check_deb(f)
+        if f.endswith(".dsc"):
+            check_dsc(f)
         # else: => byhand
 
 def main ():
@@ -518,7 +518,7 @@ def main ():
 
     stdout_fd = sys.stdout
 
-    for file in args:
+    for f in args:
         try:
             if not Options["Html-Output"]:
                 # Pipe output for each argument through less
@@ -526,14 +526,14 @@ def main ():
                 # -R added to display raw control chars for colour
                 sys.stdout = less_fd
             try:
-                if file.endswith(".changes"):
-                    check_changes(file)
-                elif file.endswith(".deb") or file.endswith(".udeb"):
+                if f.endswith(".changes"):
+                    check_changes(f)
+                elif f.endswith(".deb") or f.endswith(".udeb"):
                     check_deb(file)
-                elif file.endswith(".dsc"):
-                    check_dsc(file)
+                elif f.endswith(".dsc"):
+                    check_dsc(f)
                 else:
-                    daklib.utils.fubar("Unrecognised file type: '%s'." % (file))
+                    daklib.utils.fubar("Unrecognised file type: '%s'." % (f))
             finally:
                 if not Options["Html-Output"]:
                     # Reset stdout here so future less invocations aren't FUBAR