X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcontents.py;h=ebeb2bc765b426e3c1ff3f271e4a5753ffca8d45;hb=386b8e180e28b9d5c65595b0cde7cd48fc7d0b74;hp=9e3e35d32253d87fabdbb7e1892603f6a678fce6;hpb=aeff0b009db845e9a924853846eff6fbb8e3f07b;p=dak.git diff --git a/dak/contents.py b/dak/contents.py old mode 100644 new mode 100755 index 9e3e35d3..ebeb2bc7 --- a/dak/contents.py +++ b/dak/contents.py @@ -255,9 +255,9 @@ class Contents(object): pooldir = Config()[ 'Dir::Pool' ] cursor = DBConn().cursor(); - cursor.execute( debs_q ) - cursor.execute( olddeb_q ) - cursor.execute( arches_q ) + DBConn().prepare("debs_q",debs_q) + DBConn().prepare("olddeb_q",olddeb_q) + DBConn().prepare("arches_q",arches_q) suites = self._suites() for suite in [i.lower() for i in suites]: @@ -278,13 +278,14 @@ class Contents(object): cursor1.execute( "EXECUTE olddeb_q(%d)" % (deb[0] ) ) old = cursor1.fetchone() if old: - log.debug( "already imported: %s" % deb[1] ) + log.debug( "already imported: %s" % (deb[1]) ) else: + log.debug( "scanning: %s" % (deb[1]) ) debfile = os.path.join( pooldir, deb[1] ) if os.path.exists( debfile ): - Binary(debfile, self.reject).scan_package( deb[0] ) + Binary(debfile, self.reject).scan_package(deb[0],True) else: - log.error( "missing .deb: %s" % deb[1] ) + log.error("missing .deb: %s" % deb[1]) def generate(self): """ @@ -292,9 +293,9 @@ class Contents(object): """ cursor = DBConn().cursor(); - cursor.execute( arches_q ) - cursor.execute( contents_q ) - cursor.execute( udeb_contents_q ) + DBConn().prepare( "arches_q", arches_q ) + DBConn().prepare( "contents_q", contents_q ) + DBConn().prepare( "udeb_contents_q", udeb_contents_q ) debtype_id=DBConn().get_override_type_id("deb") udebtype_id=DBConn().get_override_type_id("udeb") @@ -376,6 +377,14 @@ def main(): 'cruft' : Contents.cruft, } + args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv) + + if (len(args) < 1) or not commands.has_key(args[0]): + usage() + + if cnf.has_key("%s::%s" % (options_prefix,"Help")): + usage() + level=logging.INFO if cnf.has_key("%s::%s" % (options_prefix,"Quiet")): level=logging.ERROR @@ -388,14 +397,6 @@ def main(): format='%(asctime)s %(levelname)s %(message)s', stream = sys.stderr ) - args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv) - - if (len(args) < 1) or not commands.has_key(args[0]): - usage() - - if cnf.has_key("%s::%s" % (options_prefix,"Help")): - usage() - commands[args[0]](Contents()) if __name__ == '__main__':