X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=cameron;h=28c6f4d7cb352a8a753b4062c05b4140338f7f65;hb=080f3c9b04f77a9b873628241fbe121583d074d1;hp=6f8aeb774cd94d9cf49716792a258b5486e70ddb;hpb=d9a3227c72d6209182780b0908b65247b92b0696;p=dak.git diff --git a/cameron b/cameron index 6f8aeb77..28c6f4d7 100755 --- a/cameron +++ b/cameron @@ -1,8 +1,8 @@ #!/usr/bin/env python # Generate file list for unstable_accepted -# Copyright (C) 2002 James Troup -# $Id: cameron,v 1.1 2002-05-05 19:59:32 rmurray Exp $ +# Copyright (C) 2002 Ryan Murray +# $Id: cameron,v 1.3 2002-05-15 07:54:28 rmurray Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,38 +20,27 @@ ################################################################################ -import pg, string, os, sys -import apt_pkg -import db_access, utils, claire, logging - -################################################################################ - -projectB = None -Cnf = None -Logger = None; +import pg, os, sys; +import apt_pkg; +import db_access, utils; ################################################################################ def main(): - global Cnf, projectB; + Cnf = utils.get_conf(); - Cnf = utils.get_conf() - - Arguments = [('h',"help","Cameron::Options::Help")]; - - apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv); + apt_pkg.ParseCommandLine(Cnf,[],sys.argv); projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); db_access.init(Cnf, projectB); - list = utils.open_file("%s/unstable_accepted.list" % (Cnf["Dir::ListsDir"]), "w") + list = utils.open_file("%s/unstable_accepted.list" % (Cnf["Dir::Lists"]), "w"); q = projectB.query("SELECT filename FROM unstable_accepted WHERE in_accepted AND filename ~ '(u?deb|dsc)$'"); - entries = q.getresult(); - for entry in entries: - filename = os.path.dirname(entry[0])+'/incoming/'+os.path.basename(entry[0]); - list.write("%s\n" % (filename)) - list.close() + for entry in q.getresult(): + filename = os.path.join(os.path.dirname(entry[0]),'incoming',os.path.basename(entry[0])); + list.write("%s\n" % (filename)); + list.close(); -######################################################################################### +################################################################################ if __name__ == '__main__': - main() + main();