X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=rhona;h=c080a71ddf087cb67718e55751e988b433cae053;hb=a8dadcd66f0deaadb258a7c220856dc2c4522fc7;hp=5673e0aa62055a9a933a364aa51f5e2df85dbb3b;hpb=0e065ded4af23d7467d458fbffa889f7253f8158;p=dak.git diff --git a/rhona b/rhona index 5673e0aa..c080a71d 100755 --- a/rhona +++ b/rhona @@ -2,7 +2,7 @@ # rhona, cleans up unassociated binary and source packages # Copyright (C) 2000, 2001 James Troup -# $Id: rhona,v 1.10 2001-03-15 00:35:12 troup Exp $ +# $Id: rhona,v 1.13 2001-03-20 00:28:11 troup 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 @@ -101,7 +101,7 @@ SELECT s.id, s.file FROM source s (SELECT sa.suite FROM src_associations sa WHERE sa.source = s.id) AND NOT EXISTS (SELECT b.id FROM binaries b WHERE b.source = s.id)"""); ql = q.getresult(); - + projectB.query("BEGIN WORK"); for i in ql: source_id = i[0]; @@ -112,8 +112,8 @@ SELECT s.id, s.file FROM source s # Mark all other files references by .dsc too if they're not used by anyone else x = projectB.query("SELECT f.id FROM files f, dsc_files d WHERE d.source = %s AND d.file = f.id" % (source_id)); for j in x.getresult(): - file_id = i[0]; - y = projectB.query("SELECT id FROM dsc_files d WHERE file = %s" % (file_id)); + file_id = j[0]; + y = projectB.query("SELECT id FROM dsc_files d WHERE d.file = %s" % (file_id)); if len(y.getresult()) == 1: projectB.query("UPDATE files SET last_used = '%s' WHERE id = %s" % (delete_date, file_id)); projectB.query("COMMIT WORK"); @@ -246,13 +246,13 @@ SELECT m.id FROM maintainer m def main(): global Cnf, projectB, delete_date; - projectB = pg.connect('projectb', 'localhost'); - apt_pkg.init(); Cnf = apt_pkg.newConfiguration(); apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file()); + projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); + Arguments = [('D',"debug","Rhona::Options::Debug", "IntVal"), ('h',"help","Rhona::Options::Help"), ('n',"no-action","Rhona::Options::No-Action"),