]> git.decadent.org.uk Git - dak.git/blobdiff - dak/examine_package.py
Merge from Thomas
[dak.git] / dak / examine_package.py
index 530d0bc14132cd9be29ff37b762de898563f7603..217186c3280888230540754dad679e6ffb542de3 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python
-# -*- coding: latin-1 -*-
 
 # Script to automate some parts of checking NEW packages
 # Copyright (C) 2000, 2001, 2002, 2003, 2006  James Troup <james@nocrew.org>
@@ -33,9 +32,9 @@
 
 ################################################################################
 
-import errno, os, pg, re, sys, md5, time
+import errno, os, pg, re, sys, md5
 import apt_pkg, apt_inst
-import daklib.database, daklib.utils
+import daklib.database, daklib.utils, daklib.queue
 
 ################################################################################
 
@@ -100,7 +99,7 @@ def escape_if_needed(s):
   
 def headline(s, level=2):
   if use_html:
-    print "<h%d>%s</h%d>" % (level,html_escape(s),level)
+    print "<h%d>%s</h%d>" % (level, html_escape(s), level)
   else:
     print "---- %s ----" % (s)
 
@@ -335,16 +334,18 @@ def output_deb_info(filename):
             to_print += output + '\n'
         print_escaped_text(to_print)
 
-def do_command (command, filename):
+def do_command (command, filename, escaped=0):
     o = os.popen("%s %s" % (command, filename))
-    print_formatted_text(o.read())
+    if escaped:
+        print_escaped_text(o.read())
+    else:
+        print_formatted_text(o.read())
 
 def do_lintian (filename):
-    # lintian currently does not have html coloring, so dont use color for lintian (yet)
     if use_html:
-        do_command("lintian --show-overrides", filename)
+        do_command("lintian --show-overrides --color html", filename, 1)
     else:
-        do_command("lintian --show-overrides --color always", filename)
+        do_command("lintian --show-overrides --color always", filename, 1)
 
 def print_copyright (deb_filename):
     package = re_package.sub(r'\1', deb_filename)
@@ -392,19 +393,17 @@ def check_deb (deb_filename):
     output_deb_info(deb_filename)
 
     if is_a_udeb:
-       headline("skipping lintian check for µdeb")
+       headline("skipping lintian check for udeb")
        print 
     else:
        headline("lintian check for %s" % (filename))
         do_lintian(deb_filename)
-       headline("---- linda check for %s ----" % (filename))
-        do_command ("linda", deb_filename)
 
     headline("contents of %s" % (filename))
     do_command ("dpkg -c", deb_filename)
 
     if is_a_udeb:
-       headline("skipping copyright for µdeb")
+       headline("skipping copyright for udeb")
     else:
        headline("copyright of %s" % (filename))
         print_copyright(deb_filename)
@@ -463,7 +462,7 @@ def main ():
 #    Cnf = daklib.utils.get_conf()
 
     Arguments = [('h',"help","Examine-Package::Options::Help"),
-                 ('H',"Html-output","Examine-Package::Options::Html-Output"),
+                 ('H',"html-output","Examine-Package::Options::Html-Output"),
                 ]
     for i in [ "Help", "Html-Output", "partial-html" ]:
        if not Cnf.has_key("Examine-Package::Options::%s" % (i)):