From 2286ce0734fe5dadf2b601165f56d2ebb5a91a5a Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Fri, 25 Nov 2005 06:59:45 +0000 Subject: [PATCH] Changed accepted_autobuild to queue_build everywhere.Add a queue table.Add a "queue" field in the queue_build table (currently always 0) --- ChangeLog | 6 ++++++ TODO | 2 +- add_constraints.sql | 7 ++++--- cron.daily | 2 +- cron.unchecked | 2 +- docs/README.config | 12 ++++++------ init_pool.sql | 10 ++++++++-- katie.conf | 6 +++--- katie.conf-security | 8 ++++---- katie.py | 16 ++++++++-------- kelly | 16 ++++++++-------- rhona | 24 ++++++++++++------------ sql-aptvc.cpp | 2 +- 13 files changed, 63 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8e85425..81a009f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-25 Anthony Towns + + * Changed accepted_autobuild to queue_build everywhere. + * Add a queue table. + * Add a "queue" field in the queue_build table (currently always 0) + 2005-11-25 Anthony Towns * Finishing merge of changes from spohr, by various people still diff --git a/TODO b/TODO index e8a3d6a9..389958c4 100644 --- a/TODO +++ b/TODO @@ -189,7 +189,7 @@ Others were pulled out in -2, and we end up with no orig in the archive :( - o SecurityAcceptedAutoBuild doesn't handle the case of foo_3.3woody1 + o SecurityQueueBuild doesn't handle the case of foo_3.3woody1 with a new .orig.tar.gz followed by a foo_3.3potato1 with the same .orig.tar.gz; jennifer sees it and copes, but the AA code doesn't and can't really easily know so the potato AA dir is left with no diff --git a/add_constraints.sql b/add_constraints.sql index 9b7eb766..f25165c1 100644 --- a/add_constraints.sql +++ b/add_constraints.sql @@ -32,7 +32,8 @@ ALTER TABLE override ADD CONSTRAINT override_priority FOREIGN KEY (priority) REF ALTER TABLE override ADD CONSTRAINT override_section FOREIGN KEY (section) REFERENCES section(id) MATCH FULL; ALTER TABLE override ADD CONSTRAINT override_type FOREIGN KEY (type) REFERENCES override_type(id) MATCH FULL; -ALTER TABLE accepted_autobuild ADD CONSTRAINT accepted_autobuild_suite FOREIGN KEY (suite) REFERENCES suite(id) MATCH FULL; +ALTER TABLE queue_build ADD CONSTRAINT queue_build_suite FOREIGN KEY (suite) REFERENCES suite(id) MATCH FULL; +ALTER TABLE queue_build ADD CONSTRAINT queue_build_queue FOREIGN KEY (queue) REFERENCES queue(id) MATCH FULL; -- Then correct all the id SERIAL PRIMARY KEY columns... @@ -107,7 +108,7 @@ GRANT ALL ON architecture, architecture_id_seq, archive, maintainer_id_seq, override, override_type, override_type_id_seq, priority, priority_id_seq, section, section_id_seq, source, source_id_seq, src_associations, src_associations_id_seq, suite, - suite_architectures, suite_id_seq, accepted_autobuild, uid, + suite_architectures, suite_id_seq, queue_build, uid, uid_id_seq TO GROUP ftpmaster; -- Read only access to user 'nobody' @@ -119,5 +120,5 @@ GRANT SELECT ON architecture, architecture_id_seq, archive, maintainer_id_seq, override, override_type, override_type_id_seq, priority, priority_id_seq, section, section_id_seq, source, source_id_seq, src_associations, src_associations_id_seq, suite, - suite_architectures, suite_id_seq, accepted_autobuild, uid, + suite_architectures, suite_id_seq, queue_build, uid, uid_id_seq TO PUBLIC; diff --git a/cron.daily b/cron.daily index 6d80d3e4..c7e48a23 100755 --- a/cron.daily +++ b/cron.daily @@ -91,7 +91,7 @@ shania # Needs to be rebuilt, as files have moved. Due to unaccepts, we need to # update this before wanna-build is updated. -psql projectb -A -t -q -c "SELECT filename FROM accepted_autobuild WHERE suite = 5 AND in_accepted = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list +psql projectb -A -t -q -c "SELECT filename FROM queue_build WHERE suite = 5 AND queue = 0 AND in_queue = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list apt-ftparchive generate apt.conf.buildd mkmaintainers diff --git a/cron.unchecked b/cron.unchecked index a96ec091..b14b442d 100644 --- a/cron.unchecked +++ b/cron.unchecked @@ -30,7 +30,7 @@ if lockfile -r3 $LOCKFILE; then if lockfile -r3 $NOTICE; then LOCKDAILY="YES" - psql projectb -A -t -q -c "SELECT filename FROM accepted_autobuild WHERE suite = 5 AND in_accepted = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list + psql projectb -A -t -q -c "SELECT filename FROM queue_build WHERE queue = 0 AND suite = 5 AND in_queue = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list cd $overridedir denise &>/dev/null rm -f override.sid.all3 override.sid.all3.src diff --git a/docs/README.config b/docs/README.config index c273c71d..1bd0b1d7 100644 --- a/docs/README.config +++ b/docs/README.config @@ -40,7 +40,7 @@ Mandatory. List of directory locations, e.g. | Log "/org/ftp.debian.org/log/"; | Morgue "/org/ftp.debian.org/morgue/"; | MorgueReject "reject"; -| AcceptedAutoBuild "/org/incoming.debian.org/buildd/"; +| QueueBuild "/org/incoming.debian.org/buildd/"; | UrgencyLog "/org/ftp.debian.org/testing/urgencies/"; | Queue | { @@ -82,8 +82,8 @@ MorgueReject (required): if katie cannot move a rejected package to Dir::Queue::Reject, it will try to move it to the Dir::MorgueReject directory located under Dir::Morgue. -AcceptedAutoBuild (optional): This variable is only relevant if any suites -are to be auto built, i.e. if Dinstall::AcceptedAutoBuildSuites has any +QueueBuild (optional): This variable is only relevant if any suites +are to be auto built, i.e. if Dinstall::QueueBuildSuites has any values. UrgencyLog (optional): If this directory is specified, kelly will store the @@ -216,7 +216,7 @@ Mandatory. List of dinstall options, e.g.: | FutureTimeTravelGrace 28800; // 8 hours | PastCutoffYear "1984"; | BXANotify "false"; -| AcceptedAutoBuildSuites +| QueueBuildSuites | { | unstable; | }; @@ -274,10 +274,10 @@ at the maintainer if they differ. CloseBugs (optional): a boolean (default: no); if true the automated bug closing feature of dinstall is activated. -AcceptedAutoBuildSuites (optional): a list of suites which should be auto +QueueBuildSuites (optional): a list of suites which should be auto build. -SpecialAcceptedAutoBuild is a boolean; if true it activates support +QueueBuild is a boolean; if true it activates support for auto-building from accepted. OverrideMaintainer (optional): be used to globally override the diff --git a/init_pool.sql b/init_pool.sql index 093e0291..3355dc5a 100644 --- a/init_pool.sql +++ b/init_pool.sql @@ -101,6 +101,11 @@ CREATE TABLE suite ( description TEXT ); +CREATE TABLE queue ( + id SERIAL PRIMARY KEY, + suite_name TEXT NOT NULL +); + CREATE TABLE suite_architectures ( suite INT4 NOT NULL, -- REFERENCES suite architecture INT4 NOT NULL, -- REFERENCES architecture @@ -148,10 +153,11 @@ CREATE TABLE override ( unique (suite, component, package, type) ); -CREATE TABLE accepted_autobuild ( +CREATE TABLE queue_build ( suite INT4 NOT NULL, -- references suite + queue INT4 NOT NULL, -- references queue filename TEXT NOT NULL, - in_accepted BOOLEAN NOT NULL, + in_queue BOOLEAN NOT NULL, last_used TIMESTAMP ); diff --git a/katie.conf b/katie.conf index 40e0597f..fc6712fb 100644 --- a/katie.conf +++ b/katie.conf @@ -24,7 +24,7 @@ Dinstall OverrideDisparityCheck "true"; StableDislocationSupport "false"; DefaultSuite "unstable"; - AcceptedAutoBuildSuites + QueueBuildSuites { unstable; }; @@ -130,7 +130,7 @@ Rhona { // How long (in seconds) dead packages are left before being killed StayOfExecution 129600; // 1.5 days - AcceptedAutoBuildStayOfExecution 86400; // 24 hours + QueueBuildStayOfExecution 86400; // 24 hours MorgueSubDir "rhona"; }; @@ -509,7 +509,7 @@ Dir Morgue "/org/ftp.debian.org/morgue/"; MorgueReject "reject"; Override "/org/ftp.debian.org/scripts/override/"; - AcceptedAutoBuild "/org/incoming.debian.org/buildd/"; + QueueBuild "/org/incoming.debian.org/buildd/"; UrgencyLog "/org/ftp.debian.org/testing/urgencies/"; Queue { diff --git a/katie.conf-security b/katie.conf-security index cb4b37d5..3d6e6198 100644 --- a/katie.conf-security +++ b/katie.conf-security @@ -21,12 +21,12 @@ Dinstall CloseBugs "false"; OverrideDisparityCheck "false"; BXANotify "false"; - AcceptedAutoBuildSuites + QueueBuildSuites { stable; testing; }; - SecurityAcceptedAutoBuild "true"; + SecurityQueueBuild "true"; DefaultSuite "Testing"; SuiteSuffix "updates"; OverrideMaintainer "katie@security.debian.org"; @@ -80,7 +80,7 @@ Rhona { // How long (in seconds) dead packages are left before being killed StayOfExecution 129600; // 1.5 days - AcceptedAutoBuildStayOfExecution 86400; // 24 hours + QueueBuildStayOfExecution 86400; // 24 hours MorgueSubDir "rhona"; OverrideFilename "override.source-only"; }; @@ -194,7 +194,7 @@ Dir Morgue "/org/security.debian.org/morgue/"; MorgueReject "reject"; Override "/org/security.debian.org/scripts/override/"; - AcceptedAutoBuild "/org/security.debian.org/buildd/"; + QueueBuild "/org/security.debian.org/buildd/"; Queue { Accepted "/org/security.debian.org/queue/accepted/"; diff --git a/katie.py b/katie.py index 7842d233..5b840f1f 100644 --- a/katie.py +++ b/katie.py @@ -2,7 +2,7 @@ # Utility functions for katie # Copyright (C) 2001, 2002, 2003, 2004, 2005 James Troup -# $Id: katie.py,v 1.55 2005-11-25 04:40:14 ajt Exp $ +# $Id: katie.py,v 1.56 2005-11-25 06:59:45 ajt 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 @@ -453,23 +453,23 @@ distribution."""; ## Special support to enable clean auto-building of accepted packages self.projectB.query("BEGIN WORK"); for suite in changes["distribution"].keys(): - if suite not in Cnf.ValueList("Dinstall::AcceptedAutoBuildSuites"): + if suite not in Cnf.ValueList("Dinstall::QueueBuildSuites"): continue; suite_id = db_access.get_suite_id(suite); - dest_dir = Cnf["Dir::AcceptedAutoBuild"]; - if Cnf.FindB("Dinstall::SecurityAcceptedAutoBuild"): + dest_dir = Cnf["Dir::QueueBuild"]; + if Cnf.FindB("Dinstall::SecurityQueueBuild"): dest_dir = os.path.join(dest_dir, suite); for file in file_keys: src = os.path.join(Cnf["Dir::Queue::Accepted"], file); dest = os.path.join(dest_dir, file); - if Cnf.FindB("Dinstall::SecurityAcceptedAutoBuild"): + if Cnf.FindB("Dinstall::SecurityQueueBuild"): # Copy it since the original won't be readable by www-data utils.copy(src, dest); else: # Create a symlink to it os.symlink(src, dest); # Add it to the list of packages for later processing by apt-ftparchive - self.projectB.query("INSERT INTO accepted_autobuild (suite, filename, in_accepted) VALUES (%s, '%s', 't')" % (suite_id, dest)); + self.projectB.query("INSERT INTO queue_build (suite, queue, filename, in_queue) VALUES (%s, 0, '%s', 't')" % (suite_id, dest)); # If the .orig.tar.gz is in the pool, create a symlink to # it (if one doesn't already exist) if self.pkg.orig_tar_id: @@ -488,10 +488,10 @@ distribution."""; src = os.path.join(ql[0][0], ql[0][1]); os.symlink(src, dest); # Add it to the list of packages for later processing by apt-ftparchive - self.projectB.query("INSERT INTO accepted_autobuild (suite, filename, in_accepted) VALUES (%s, '%s', 't')" % (suite_id, dest)); + self.projectB.query("INSERT INTO queue_build (suite, queue, filename, in_queue) VALUES (%s, 0, '%s', 't')" % (suite_id, dest)); # if it does, update things to ensure it's not removed prematurely else: - self.projectB.query("UPDATE accepted_autobuild SET in_accepted = 't', last_used = NULL WHERE filename = '%s' AND suite = %s" % (dest, suite_id)); + self.projectB.query("UPDATE queue_build SET in_queue = 't', last_used = NULL WHERE filename = '%s' AND suite = %s" % (dest, suite_id)); self.projectB.query("COMMIT WORK"); diff --git a/kelly b/kelly index 12bcb5a3..a941842f 100755 --- a/kelly +++ b/kelly @@ -2,7 +2,7 @@ # Installs Debian packages from queue/accepted into the pool # Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup -# $Id: kelly,v 1.16 2005-11-15 09:50:32 ajt Exp $ +# $Id: kelly,v 1.17 2005-11-25 06:59:45 ajt 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 @@ -37,7 +37,7 @@ import db_access, katie, logging, utils; ############################################################################### # Globals -kelly_version = "$Revision: 1.16 $"; +kelly_version = "$Revision: 1.17 $"; Cnf = None; Options = None; @@ -421,18 +421,18 @@ def install (): # from accepted. projectB.query("BEGIN WORK"); for suite in changes["distribution"].keys(): - if suite not in Cnf.ValueList("Dinstall::AcceptedAutoBuildSuites"): + if suite not in Cnf.ValueList("Dinstall::QueueBuildSuites"): continue; now_date = time.strftime("%Y-%m-%d %H:%M"); suite_id = db_access.get_suite_id(suite); - dest_dir = Cnf["Dir::AcceptedAutoBuild"]; - if Cnf.FindB("Dinstall::SecurityAcceptedAutoBuild"): + dest_dir = Cnf["Dir::QueueBuild"]; + if Cnf.FindB("Dinstall::SecurityQueueBuild"): dest_dir = os.path.join(dest_dir, suite); for file in files.keys(): dest = os.path.join(dest_dir, file); # Remove it from the list of packages for later processing by apt-ftparchive - projectB.query("UPDATE accepted_autobuild SET in_accepted = 'f', last_used = '%s' WHERE filename = '%s' AND suite = %s" % (now_date, dest, suite_id)); - if not Cnf.FindB("Dinstall::SecurityAcceptedAutoBuild"): + projectB.query("UPDATE queue_build SET in_queue = 'f', last_used = '%s' WHERE filename = '%s' AND suite = %s" % (now_date, dest, suite_id)); + if not Cnf.FindB("Dinstall::SecurityQueueBuild"): # Update the symlink to point to the new location in the pool pool_location = utils.poolify (changes["source"], files[file]["component"]); src = os.path.join(Cnf["Dir::Pool"], pool_location, os.path.basename(file)); @@ -446,7 +446,7 @@ def install (): if dsc_file.endswith(".orig.tar.gz"): orig_tar_gz = os.path.join(dest_dir, dsc_file); # Remove it from the list of packages for later processing by apt-ftparchive - projectB.query("UPDATE accepted_autobuild SET in_accepted = 'f', last_used = '%s' WHERE filename = '%s' AND suite = %s" % (now_date, orig_tar_gz, suite_id)); + projectB.query("UPDATE queue_build SET in_queue = 'f', last_used = '%s' WHERE filename = '%s' AND suite = %s" % (now_date, orig_tar_gz, suite_id)); projectB.query("COMMIT WORK"); # Finally... diff --git a/rhona b/rhona index 409b5fe4..fdbcf26d 100755 --- a/rhona +++ b/rhona @@ -2,7 +2,7 @@ # rhona, cleans up unassociated binary and source packages # Copyright (C) 2000, 2001, 2002, 2003 James Troup -# $Id: rhona,v 1.28 2005-11-25 04:42:59 ajt Exp $ +# $Id: rhona,v 1.29 2005-11-25 06:59:45 ajt 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 @@ -291,31 +291,31 @@ SELECT f.id FROM fingerprint f ################################################################################ -def clean_accepted_autobuild(): +def clean_queue_build(): global now_date; - if not Cnf.ValueList("Dinstall::AcceptedAutoBuildSuites") or Options["No-Action"]: + if not Cnf.ValueList("Dinstall::QueueBuildSuites") or Options["No-Action"]: return; - print "Cleaning out accepted autobuild symlinks..." + print "Cleaning out queue build symlinks..." - our_delete_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()-int(Cnf["Rhona::AcceptedAutoBuildStayOfExecution"]))); + our_delete_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()-int(Cnf["Rhona::QueueBuildStayOfExecution"]))); count = 0; - q = projectB.query("SELECT filename FROM accepted_autobuild WHERE last_used <= '%s'" % (our_delete_date)); + q = projectB.query("SELECT filename FROM queue_build WHERE last_used <= '%s'" % (our_delete_date)); for i in q.getresult(): filename = i[0]; if not os.path.exists(filename): - utils.warn("%s (from accepted_autobuild) doesn't exist." % (filename)); + utils.warn("%s (from queue_build) doesn't exist." % (filename)); continue; - if not Cnf.FindB("Dinstall::SecurityAcceptedAutoBuild") and not os.path.islink(filename): - utils.fubar("%s (from accepted_autobuild) should be a symlink but isn't." % (filename)); + if not Cnf.FindB("Dinstall::SecurityQueueBuild") and not os.path.islink(filename): + utils.fubar("%s (from queue_build) should be a symlink but isn't." % (filename)); os.unlink(filename); count += 1; - projectB.query("DELETE FROM accepted_autobuild WHERE last_used <= '%s'" % (our_delete_date)); + projectB.query("DELETE FROM queue_build WHERE last_used <= '%s'" % (our_delete_date)); if count: - sys.stderr.write("Cleaned %d accepted-autobuild files.\n" % (count)); + sys.stderr.write("Cleaned %d queue_build files.\n" % (count)); ################################################################################ @@ -348,7 +348,7 @@ def main(): clean(); clean_maintainers(); clean_fingerprints(); - clean_accepted_autobuild(); + clean_queue_build(); ################################################################################ diff --git a/sql-aptvc.cpp b/sql-aptvc.cpp index 6f14ee64..54ba9e92 100644 --- a/sql-aptvc.cpp +++ b/sql-aptvc.cpp @@ -25,7 +25,7 @@ extern "C" { -#include +#include int versioncmp(text *A, text *B); -- 2.39.2