X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcontents.py;h=ebeb2bc765b426e3c1ff3f271e4a5753ffca8d45;hb=b7e5c9a6deda1018da9023d1d01acec86e165ba4;hp=d12440f1e56a6c4a0e4487bb3a2afd9f0a59de79;hpb=0de0852e9dce3a4ac0f9d18f2479ab899a2060a9;p=dak.git diff --git a/dak/contents.py b/dak/contents.py old mode 100644 new mode 100755 index d12440f1..ebeb2bc7 --- a/dak/contents.py +++ b/dak/contents.py @@ -242,9 +242,9 @@ class Contents(object): """ cursor = DBConn().cursor(); cursor.execute( "BEGIN WORK" ) - DBConn().prepare("remove_pending_contents_cruft_q", remove_pending_contents_cruft_q) - DBConn().prepare("remove_filename_cruft_q", remove_filename_cruft_q) - DBConn().prepare("remove_filepath_cruft_q", remove_filepath_cruft_q) + cursor.execute( remove_pending_contents_cruft_q ) + cursor.execute( remove_filename_cruft_q ) + cursor.execute( remove_filepath_cruft_q ) cursor.execute( "COMMIT" ) @@ -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): """ @@ -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__':