From ba18f507ebb85f05a410e94c76cbc13add116d0e Mon Sep 17 00:00:00 2001 From: James Troup Date: Fri, 24 Nov 2000 04:04:23 +0000 Subject: [PATCH] rhona clean ups. --- cron.daily-non-US | 5 +++++ katie.conf | 2 +- katie.conf-non-US | 2 +- rhona | 31 ++++++++++++++++++++++++------- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/cron.daily-non-US b/cron.daily-non-US index 553775f8..f647e7d9 100755 --- a/cron.daily-non-US +++ b/cron.daily-non-US @@ -50,7 +50,12 @@ symlinks -d -r $ftpdir cd $masterdir jenna +# FIXME +cd /org/non-us.debian.org/database/dists/ +for i in proposed-updates_-_binary-*; do cat $i >> proposed-updates_-_binary.list; done +cd $masterdir apt-ftparchive generate apt.conf-non-US +rhona cd $indices charisma > .new-maintainers mv -f .new-maintainers Maintainers diff --git a/katie.conf b/katie.conf index 40d39c6a..4a9af230 100644 --- a/katie.conf +++ b/katie.conf @@ -78,7 +78,7 @@ Rhona //Morgue "/org/ftp.debian.org/morgue/"; Morgue "/org/scratch/troup/morgue/"; // How long (in seconds) dead packages are left before being killed - StayOfExecution 259200; + StayOfExecution 172800; // 2 days }; Suite diff --git a/katie.conf-non-US b/katie.conf-non-US index a4b7a352..2114eee5 100644 --- a/katie.conf-non-US +++ b/katie.conf-non-US @@ -77,7 +77,7 @@ Rhona Morgue "/org/non-us.debian.org/morgue/"; // How long (in seconds) dead packages are left before being killed - StayOfExecution 259200; + StayOfExecution 172800; // 2 days }; Suite diff --git a/rhona b/rhona index be70dddb..7b0d9310 100755 --- a/rhona +++ b/rhona @@ -2,7 +2,7 @@ # rhona, cleans up unassociated binary (and source) packages # Copyright (C) 2000 James Troup -# $Id: rhona,v 1.1.1.1 2000-11-24 00:20:10 troup Exp $ +# $Id: rhona,v 1.2 2000-11-24 04:04:23 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 @@ -33,7 +33,6 @@ projectB = None Cnf = None def check_binaries(): - # A nicer way to do this would be `SELECT bin FROM # bin_associations EXCEPT SELECT id from binaries WHERE # last_update IS NULL', but it seems postgresql can't handle that @@ -75,7 +74,6 @@ def check_binaries(): projectB.query("COMMIT WORK"); def check_sources(): - # A nicer way to do this would be using `EXCEPT', but see the # commeint in process_binary. @@ -100,15 +98,13 @@ def check_sources(): q = projectB.query("SELECT f.id FROM files f, dsc_files d WHERE d.source = %d AND d.file = f.id" % (id)); ql = q.getresult(); for i in ql: - q_others = projectB.query("SELECT id FROM dsc_files d WHERE file = %s" % (i[0])); + q_others = projectB.query("SELECT file FROM dsc_files d WHERE file = %s" % (i[0])); ql_others = q.getresult(); if len(ql) == 1: projectB.query("UPDATE files SET last_used = '%s' WHERE id = %s" % (date, i[0])); projectB.query("COMMIT WORK"); # Check for any sources which are marked for eventual deletion but are now used again. - # Need to check versus dsc_files too! - all_marked_sources = {}; q = projectB.query("SELECT s.id, s.file FROM source s, files f WHERE f.last_used IS NOT NULL AND f.id = s.file"); ql = q.getresult(); @@ -121,7 +117,28 @@ def check_sources(): print "W: %s has released %s from the target list." % (id, all_marked_sources[id]); projectB.query("UPDATE files SET last_used = NULL WHERE id = %s" % (all_marked_sources[id])); # Unmark all other files references by .dsc too - q = projectB.query("SELECT id FROM dsc_files WHERE source = %d" % (id)); + q = projectB.query("SELECT file FROM dsc_files WHERE source = %d" % (id)); + ql = q.getresult(); + for i in ql: + projectB.query("UPDATE files SET last_used = NULL WHERE id = %s" % (i[0])); + projectB.query("COMMIT WORK"); + + # Whee, check for any source files (i.e. non .dsc) which are + # marked for eventual deletion but are now used by a source + # package again. + all_marked_dsc_files = {} + q = projectB.query("SELECT s.id, s.file FROM source s, files f, dsc_files d WHERE f.last_used IS NOT NULL AND f.id = d.file AND d.source = s.id"); + ql = q.getresult(); + for i in ql: + all_marked_dsc_files[i[0]] = i[1]; + projectB.query("BEGIN WORK"); + for id in all_marked_dsc_files.keys(): + if linked_sources.has_key(id): + # Can't imagine why this would happen, so warn about it for now. + print "W: %s has released %s from the target list." % (id, all_marked_sources[id]); + projectB.query("UPDATE files SET last_used = NULL WHERE id = %s" % (all_marked_sources[id])); + # Unmark all other files references by .dsc too + q = projectB.query("SELECT file FROM dsc_files WHERE source = %d" % (id)); ql = q.getresult(); for i in ql: projectB.query("UPDATE files SET last_used = NULL WHERE id = %s" % (i[0])); -- 2.39.5