#!/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>
################################################################################
-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
################################################################################
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)
else:
output += escape_if_needed(control.Find(key))
to_print += output + '\n'
- print_formatted_text(to_print)
+ 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)
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)
# 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)):