From b037a167deff2cb93e39e6baa11dd23a73ba98e1 Mon Sep 17 00:00:00 2001 From: James Troup Date: Wed, 24 Apr 2002 01:56:24 +0000 Subject: [PATCH 01/16] auto-building support take 2 --- katie | 32 ++++++++++++++++++-------------- katie.py | 29 ++++++++++++++++------------- rhona | 30 +++++++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 28 deletions(-) diff --git a/katie b/katie index 133000f7..08e6d4fa 100755 --- a/katie +++ b/katie @@ -2,7 +2,7 @@ # Installs Debian packages # Copyright (C) 2000, 2001 James Troup -# $Id: katie,v 1.78 2002-04-20 13:13:32 troup Exp $ +# $Id: katie,v 1.79 2002-04-24 01:56:24 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 @@ -39,7 +39,7 @@ import db_access, katie, logging, utils; ############################################################################### # Globals -katie_version = "$Revision: 1.78 $"; +katie_version = "$Revision: 1.79 $"; Cnf = None; Options = None; @@ -388,25 +388,29 @@ def install (): if changes["architecture"].has_key("source"): Urgency_Logger.log(dsc["source"], dsc["version"], changes["urgency"]); - ## FIXME: this should go away to some Debian specific file # Undo the work done in katie.py(accept) to help auto-building - # from accepted - if changes["distribution"].has_key("unstable"): + # from accepted. + if Cnf.get("Dinstall::SpecialAcceptedAutoBuild") and \ + changes["distribution"].has_key("unstable"): + now_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time())); projectB.query("BEGIN WORK"); - # Remove it from the list of packages for later processing by apt-ftparchive for file in files.keys(): - if files[file]["type"] == "dsc" or files[file]["type"] == "deb": - filename = os.path.join(Cnf["Dir::QueueAcceptedDir"], file); - projectB.query("DELETE FROM unstable_accepted WHERE filename = '%s'" % (filename)); - # Remove any .orig.tar.gz symlink + dest = os.path.join(Cnf["Dir::AcceptedAutoBuild"], file); + # Remove it from the list of packages for later processing by apt-ftparchive + projectB.query("UPDATE unstable_accepted SET in_accepted = 'f', last_used = '%s' WHERE filename = '%s'" % (now_date, dest)); + # 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::PoolDir"], pool_location, os.path.basename(file)); + os.unlink(dest); + os.symlink(src, dest); + # Update last_used on any non-upload .orig.tar.gz symlink if orig_tar_id: # Determine the .orig.tar.gz file name for dsc_file in dsc_files.keys(): if dsc_file[-12:] == ".orig.tar.gz": - orig_tar_gz = os.path.join(Cnf["Dir::QueueAcceptedDir"],dsc_file); - # Remove it if it's a symlink - if os.path.exists(orig_tar_gz) and os.path.islink(orig_tar_gz): - os.unlink(orig_tar_gz); + orig_tar_gz = os.path.join(Cnf["Dir::AcceptedAutoBuild"], dsc_file); + # Remove it from the list of packages for later processing by apt-ftparchive + projectB.query("UPDATE unstable_accepted SET in_accepted = 'f', last_used = '%s' WHERE filename = '%s'" % (now_date, orig_tar_gz)); projectB.query("COMMIT WORK"); install_count = install_count + 1; diff --git a/katie.py b/katie.py index 871da565..b49c1677 100644 --- a/katie.py +++ b/katie.py @@ -2,7 +2,7 @@ # Utility functions for katie # Copyright (C) 2001 James Troup -# $Id: katie.py,v 1.15 2002-04-21 15:38:29 troup Exp $ +# $Id: katie.py,v 1.16 2002-04-24 01:56:24 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 @@ -357,24 +357,25 @@ class Katie: utils.send_mail(mail_message, "") self.announce(short_summary, 1) - ## FIXME: this should go away to some Debian specific file - # If we're accepting something for unstable do extra work to - # make it auto-buildable from accepted - if self.pkg.changes["distribution"].has_key("unstable"): + # Special support to enable clean auto-building of accepted packages + if Cnf.get("Dinstall::SpecialAcceptedAutoBuild") and \ + self.pkg.changes["distribution"].has_key("unstable"): self.projectB.query("BEGIN WORK"); - # Add it to the list of packages for later processing by apt-ftparchive for file in file_keys: - if files[file]["type"] == "dsc" or files[file]["type"] == "deb": - filename = os.path.join(Cnf["Dir::QueueAcceptedDir"], file); - self.projectB.query("INSERT INTO unstable_accepted (filename) VALUES ('%s')" % (filename)); - # If the .orig.tar.gz is in the pool, create a symlink (if - # one doesn't already exist) + src = os.path.join(Cnf["Dir::QueueAcceptedDir"], file); + dest = os.path.join(Cnf["Dir::AcceptedAutoBuild"], file); + # 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 unstable_accepted (filename, in_accepted) VALUES ('%s', 't')" % (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: # Determine the .orig.tar.gz file name for dsc_file in self.pkg.dsc_files.keys(): if dsc_file[-12:] == ".orig.tar.gz": filename = dsc_file; - dest = os.path.join(Cnf["Dir::QueueAcceptedDir"],filename); + dest = os.path.join(Cnf["Dir::AcceptedAutoBuild"],filename); # If it doesn't exist, create a symlink if not os.path.exists(dest): # Find the .orig.tar.gz in the pool @@ -384,6 +385,9 @@ class Katie: utils.fubar("[INTERNAL ERROR] Couldn't find id %s in files table." % (self.pkg.orig_tar_id)); 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 unstable_accepted (filename, in_accepted) VALUES ('%s', 't')" % (dest)); + self.projectB.query("COMMIT WORK"); ########################################################################### @@ -459,7 +463,6 @@ class Katie: # safely overwrite it. utils.move(file, dest_file, 1, perms=0660); - ########################################################################### def do_reject (self, manual = 0, reject_message = ""): diff --git a/rhona b/rhona index c5e63df0..83f3da44 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.21 2002-04-22 11:06:49 troup Exp $ +# $Id: rhona,v 1.22 2002-04-24 01:56:24 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 @@ -285,6 +285,33 @@ SELECT f.id FROM fingerprint f ################################################################################ +def clean_accepted_autobuild(): + global now_date; + + if not Cnf.get("Dinstall::SpecialAcceptedAutoBuild") or Options["No-Action"]: + return; + + print "Cleaning out accepted autobuild symlinks..." + + our_delete_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()-int(Cnf["Rhona::AcceptedAutoBuildStayOfExecution"]))); + count = 0; + + q = projectB.query("SELECT filename FROM unstable_accepted WHERE last_used <= '%s'" % (our_delete_date)); + for i in q.getresult(): + filename = i[0]; + if not os.path.exists(filename): + utils.fubar("%s (from unstable_accepted) doesn't exist." % (filename)); + if not os.path.islink(filename): + utils.fubar("%s (from unstable_accepted) should be a symlink but isn't." % (filename)); + os.unlink(filename); + count = count + 1; + projectB.query("DELETE FROM unstable_accepted WHERE last_used <= '%s'" % (our_delete_date)); + + if count > 0: + sys.stderr.write("Cleaned %d accepted-autobuild symlinks.\n" % (count)); + +################################################################################ + def main(): global Cnf, Options, projectB, delete_date, now_date; @@ -314,6 +341,7 @@ def main(): clean(); clean_maintainers(); clean_fingerprints(); + clean_accepted_autobuild(); ################################################################################ -- 2.39.5 From e48e9b576b9a0f4459494236eb6cbaa87d5bee57 Mon Sep 17 00:00:00 2001 From: James Troup Date: Mon, 29 Apr 2002 22:00:44 +0000 Subject: [PATCH 02/16] Send accepted annoucnes to PTS too --- katie.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/katie.py b/katie.py index b49c1677..b2ac53a9 100644 --- a/katie.py +++ b/katie.py @@ -2,7 +2,7 @@ # Utility functions for katie # Copyright (C) 2001 James Troup -# $Id: katie.py,v 1.16 2002-04-24 01:56:24 troup Exp $ +# $Id: katie.py,v 1.17 2002-04-29 22:00:44 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 @@ -288,6 +288,8 @@ class Katie: if action: Subst["__ANNOUNCE_LIST_ADDRESS__"] = list; + if Cnf.get("Dinstall::TrackingServer") and changes["architecture"].has_key("source"): + Subst["__ANNOUNCE_LIST_ADDRESS__"] = Subst["__ANNOUNCE_LIST_ADDRESS__"] + "\nBcc: %s@%s" % (changes["source"], Cnf["Dinstall::TrackingServer"]) mail_message = utils.TemplateSubst(Subst,open(Cnf["Dir::TemplatesDir"]+"/jennifer.announce","r").read()); utils.send_mail (mail_message, "") -- 2.39.5 From 80ba7d5f206f1ddff863968989697d99f6aefde5 Mon Sep 17 00:00:00 2001 From: James Troup Date: Fri, 3 May 2002 16:06:45 +0000 Subject: [PATCH 03/16] Update copyright --- alyson | 4 ++-- andrea | 4 ++-- charisma | 4 ++-- cindy | 4 ++-- db_access.py | 4 ++-- fernanda.py | 4 ++-- heidi | 4 ++-- julia | 4 ++-- madison | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/alyson b/alyson index 0440171d..62d98723 100755 --- a/alyson +++ b/alyson @@ -1,8 +1,8 @@ #!/usr/bin/env python # Sync the ISC configuartion file and the SQL database -# Copyright (C) 2000, 2001 James Troup -# $Id: alyson,v 1.7 2002-02-12 22:13:06 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup +# $Id: alyson,v 1.8 2002-05-03 16:06:45 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 diff --git a/andrea b/andrea index be7e9b32..5c32e3ae 100755 --- a/andrea +++ b/andrea @@ -1,8 +1,8 @@ #!/usr/bin/env python # Check for fixable discrepancies between stable and unstable -# Copyright (C) 2000, 2001 James Troup -# $Id: andrea,v 1.5 2001-11-18 19:57:58 rmurray Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup +# $Id: andrea,v 1.6 2002-05-03 16:06:45 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 diff --git a/charisma b/charisma index 95f99983..cc352dc1 100755 --- a/charisma +++ b/charisma @@ -1,8 +1,8 @@ #!/usr/bin/env python # Generate Maintainers file used by e.g. the Debian Bug Tracking System -# Copyright (C) 2000, 2001 James Troup -# $Id: charisma,v 1.13 2002-02-12 22:14:38 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup +# $Id: charisma,v 1.14 2002-05-03 16:06:45 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 diff --git a/cindy b/cindy index 65ff19e8..022a5582 100755 --- a/cindy +++ b/cindy @@ -1,8 +1,8 @@ #!/usr/bin/env python # Output override files for apt-ftparchive and indices/ -# Copyright (C) 2000, 2001 James Troup -# $Id: cindy,v 1.7 2002-02-12 22:13:06 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup +# $Id: cindy,v 1.8 2002-05-03 16:06:45 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 diff --git a/db_access.py b/db_access.py index 7a5d323b..ed0c4820 100644 --- a/db_access.py +++ b/db_access.py @@ -1,6 +1,6 @@ # DB access fucntions -# Copyright (C) 2000, 2001 James Troup -# $Id: db_access.py,v 1.12 2002-02-22 22:49:19 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup +# $Id: db_access.py,v 1.13 2002-05-03 16:06:45 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 diff --git a/fernanda.py b/fernanda.py index 728ab733..c94aae25 100755 --- a/fernanda.py +++ b/fernanda.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # Script to automate some parts of checking NEW packages -# Copyright (C) 2000, 2001 James Troup -# $Id: fernanda.py,v 1.1 2002-02-12 23:08:07 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup +# $Id: fernanda.py,v 1.2 2002-05-03 16:06:45 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 diff --git a/heidi b/heidi index 7309da94..e2fba0bf 100755 --- a/heidi +++ b/heidi @@ -1,8 +1,8 @@ #!/usr/bin/env python # Manipulate suite tags -# Copyright (C) 2000, 2001 James Troup -# $Id: heidi,v 1.12 2002-02-12 22:14:38 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup +# $Id: heidi,v 1.13 2002-05-03 16:06:45 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 diff --git a/julia b/julia index f6906f51..07e43672 100755 --- a/julia +++ b/julia @@ -1,8 +1,8 @@ #!/usr/bin/env python # Sync PostgreSQL with (LDAP-generated) passwd file -# Copyright (C) 2001 James Troup -# $Id: julia,v 1.5 2002-02-12 22:14:38 troup Exp $ +# Copyright (C) 2001, 2002 James Troup +# $Id: julia,v 1.6 2002-05-03 16:06:45 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 diff --git a/madison b/madison index f32157b3..9af18d9f 100755 --- a/madison +++ b/madison @@ -1,8 +1,8 @@ #!/usr/bin/env python # Display information about package(s) (suite, version, etc.) -# Copyright (C) 2000, 2001 James Troup -# $Id: madison,v 1.17 2002-03-29 15:58:02 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup +# $Id: madison,v 1.18 2002-05-03 16:06:45 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 -- 2.39.5 From d9a3227c72d6209182780b0908b65247b92b0696 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sun, 5 May 2002 19:59:32 +0000 Subject: [PATCH 04/16] add s390 to arch list, autobuilding from accepted bits --- apt.conf.buildd | 29 +++++++++++++++++++++++++ cameron | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ cron.buildd | 20 +++++++++++++++++ vars | 2 +- 4 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 apt.conf.buildd create mode 100755 cameron create mode 100644 cron.buildd diff --git a/apt.conf.buildd b/apt.conf.buildd new file mode 100644 index 00000000..ddf92245 --- /dev/null +++ b/apt.conf.buildd @@ -0,0 +1,29 @@ +Dir +{ + ArchiveDir "/org/incoming.debian.org/buildd/"; + OverrideDir "/org/ftp.debian.org/scripts/override/"; + CacheDir "/org/ftp.debian.org/database/"; +}; + +Default +{ + Packages::Compress ". gzip"; + Sources::Compress ". gzip"; + DeLinkLimit 0; + MaxContentsChange 12000; + FileMode 0664; +} + +bindirectory "incoming" +{ + Packages "Packages"; + Sources "Sources"; + Contents " "; + + FileList "/org/ftp.debian.org/database/dists/unstable_accepted.list"; + + BinOverride "override.sid.all3"; + BinCacheDB "packages-accepted.db"; + PathPrefix ""; + Packages::Extensions ".deb .udeb"; +}; diff --git a/cameron b/cameron new file mode 100755 index 00000000..6f8aeb77 --- /dev/null +++ b/cameron @@ -0,0 +1,57 @@ +#!/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 $ + +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +################################################################################ + +import pg, string, os, sys +import apt_pkg +import db_access, utils, claire, logging + +################################################################################ + +projectB = None +Cnf = None +Logger = None; + +################################################################################ + +def main(): + global Cnf, projectB; + + Cnf = utils.get_conf() + + Arguments = [('h',"help","Cameron::Options::Help")]; + + apt_pkg.ParseCommandLine(Cnf,Arguments,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") + 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() + +######################################################################################### + +if __name__ == '__main__': + main() diff --git a/cron.buildd b/cron.buildd new file mode 100644 index 00000000..6704517e --- /dev/null +++ b/cron.buildd @@ -0,0 +1,20 @@ +#! /bin/sh +# +# Executed hourly via cron, out of katie's crontab. + +ARCHS="alpha hppa i386 ia64 mips mipsel powerpc sparc" + +set -e +export SCRIPTVARS=/org/ftp.debian.org/katie/vars +. $SCRIPTVARS + +if [ ! -e $ftpdir/Archive_Maintenance_In_Progress ]; then + cd $masterdir + cameron + apt-ftparchive -qq generate apt.conf.buildd + cd /org/incoming.debian.org/buildd + for a in $ARCHS; do + quinn-diff -a /org/buildd.debian.org/web/quinn-diff/Packages-arch-specific -A $a 2>/dev/null | grep -v ^non-free | wanna-build -b $a/build-db --merge-partial-quinn 2> /dev/null + wanna-build -A $a -b $a/build-db --merge-packages Packages 2>/dev/null + done +fi diff --git a/vars b/vars index 5d40443a..00154b28 100644 --- a/vars +++ b/vars @@ -4,7 +4,7 @@ base=/org/ftp.debian.org ftpdir=$base/ftp webdir=$base/web indices=$ftpdir/indices -archs="alpha arm hppa hurd-i386 i386 ia64 m68k powerpc sparc mips mipsel sh" +archs="alpha arm hppa hurd-i386 i386 ia64 m68k powerpc sparc mips mipsel sh s390" scriptdir=$base/scripts masterdir=$base/katie/ -- 2.39.5 From d49cf540b71eb561ae369bc861971c43e1cbb779 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Tue, 7 May 2002 21:28:42 +0000 Subject: [PATCH 05/16] readd s390 to cron.buildd list --- cron.buildd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron.buildd b/cron.buildd index 6704517e..6ceeaac2 100644 --- a/cron.buildd +++ b/cron.buildd @@ -2,7 +2,7 @@ # # Executed hourly via cron, out of katie's crontab. -ARCHS="alpha hppa i386 ia64 mips mipsel powerpc sparc" +ARCHS="alpha hppa i386 ia64 mips mipsel powerpc sparc s390" set -e export SCRIPTVARS=/org/ftp.debian.org/katie/vars -- 2.39.5 From a3db693441c9f5d2d500397b1c610f8189dcdb37 Mon Sep 17 00:00:00 2001 From: James Troup Date: Wed, 8 May 2002 11:08:37 +0000 Subject: [PATCH 06/16] sync --- TODO | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 080a4ce4..3413a517 100644 --- a/TODO +++ b/TODO @@ -88,8 +88,6 @@ Less Urgent o Logging [mostly done] (todo: rhona (hard), .. ?) - o Abstraction of suite hardcoding (q.v. progengy) - o jennifer is leaking file descriptors.. o the tar extractor class doesn't need to be redone for each package @@ -172,11 +170,11 @@ Less Urgent * Easy: + o don't stat/md5sum files you have entries for in the DB, moron + boy (Katie.check_source_blah_blah) o promote changes["changes"] to mandatory in katie.py(dump_vars) after a month or so (or all .katie files contain in the queue contain it). - o Rationalize config stuff.. Dir::Foo not Dir::FooDir [breaks other people??] - Also Dir::Queue::Foo, not Dir::QueueFooDir o melanie should behave better with -a and without -b; see gcc-defaults removal for an example. o Reject on misconfigured kernel-package uploads -- 2.39.5 From 02fc30ba2ba16c09400912cfed5bde86b8a66daa Mon Sep 17 00:00:00 2001 From: James Troup Date: Wed, 8 May 2002 11:08:45 +0000 Subject: [PATCH 07/16] fix .katie handling --- ashley | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ashley b/ashley index fdf2c615..12b860a6 100755 --- a/ashley +++ b/ashley @@ -1,8 +1,8 @@ #!/usr/bin/env python # Dump variables from a .katie file to stdout -# Copyright (C) 2001 James Troup -# $Id: ashley,v 1.3 2002-04-20 13:13:00 troup Exp $ +# Copyright (C) 2001, 2002 James Troup +# $Id: ashley,v 1.4 2002-05-08 11:08:45 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 @@ -26,7 +26,7 @@ def main(): k = katie.Katie(Cnf); for arg in sys.argv[1:]: if arg[-6:] == ".katie": - arg = arg[:-6]+".katie"; + arg = arg[:-6]+".changes"; if arg[-8:] != ".changes": utils.warn("Skipping '%s', unknown file type." % (arg)); continue; -- 2.39.5 From e6cc279e339fde0099ecf4714aa133c357d2251e Mon Sep 17 00:00:00 2001 From: James Troup Date: Wed, 8 May 2002 11:08:54 +0000 Subject: [PATCH 08/16] update --- docs/README.config | 85 ++++++++++++++++++++++++++++++++++++++++----- docs/katie.1.sgml | 20 ++--------- docs/natalie.1.sgml | 32 ++++++++++++----- 3 files changed, 103 insertions(+), 34 deletions(-) diff --git a/docs/README.config b/docs/README.config index 1ee64ca0..56213a19 100644 --- a/docs/README.config +++ b/docs/README.config @@ -25,15 +25,28 @@ Mandatory. List of directory locations, e.g. | Dir | { -| RootDir "/org/ftp.debian.org/ftp/"; -| PoolDir "/org/ftp.debian.org/ftp/pool/"; -| TemplatesDir "/org/ftp.debian.org/katie/templates/"; +| Root "/org/ftp.debian.org/ftp/"; +| Pool "/org/ftp.debian.org/ftp/pool/"; +| Templates "/org/ftp.debian.org/katie/templates/"; | PoolRoot "pool/"; -| IncomingDir "/org/ftp.debian.org/incoming/"; -| OverrideDir "/org/ftp.debian.org/scripts/override/"; -| ListsDir "/org/ftp.debian.org/database/dists/"; -| LogDir "/org/ftp.debian.org/log/"; +| Override "/org/ftp.debian.org/scripts/override/"; +| Lists "/org/ftp.debian.org/database/dists/"; +| Log "/org/ftp.debian.org/log/"; | Morgue "/org/ftp.debian.org/morgue/"; +| Override "/org/ftp.debian.org/scripts/override/"; +| AcceptedAutoBuild "/org/incoming.debian.org/buildd/"; +| UrgencyLog "/org/ftp.debian.org/testing/urgencies/"; +| Queue +| { +| Root "/org/ftp.debian.org/queue/"; +| Accepted "/org/ftp.debian.org/queue/accepted/"; +| Byhand "/org/ftp.debian.org/queue/byhand/"; +| Done "/org/ftp.debian.org/queue/done/"; +| Holding "/org/ftp.debian.org/queue/holding/"; +| New "/org/ftp.debian.org/queue/new/"; +| Reject "/org/ftp.debian.org/queue/reject/"; +| Unchecked "/org/ftp.debian.org/queue/unchecked/"; +| }; | }; ================================================================================ @@ -86,6 +99,43 @@ paths will usually be different. ================================================================================ +SuiteMappings +------------- + +Optional. List of mappings for the Distribution file in a .changes file, e.g.: + +| SuiteMappings +| { +| "map stable proposed-updates"; +| "map frozen unstable"; +| "map-unreleased stable unstable"; +| "map-unreleased proposed-updates unstable"; +| "ignore testing"; +| }; + +There are three mapping types: + +(1) map + + Any target suite of '' is unconditionally overriden to + ''. + +(2) map-unreleased + + Any upload targeted for suite '' will be mapped to + '' iff it contains uploads for an architecture that is not + part of ''. + +(3) ignore + + Any target suite of '' is unconditionally removed from + the list of target suites. NB: if the upload had only one + target suite this will lead to rejection. + +NB: ordering is not guaranteed. + +================================================================================ + Dinstall -------- @@ -146,7 +196,26 @@ timestamps are allowed to be inside a deb before being rejected. PastCutoffYear specifies the cut-off year which is used when deciding whether or not to reject packages based on the file timestamp. -If BXANotify is non-zero/blank a (Debian-specfic) BXA notification is sent. +BXANotify is a boolean; if true (Debian-specfic) BXA notification is +sent. + +OverrideDisparityCheck is a boolean; if true, jennifer compares an +uploads section/priority with the overrides and whines at the +maintainer if they differ. + +CloseBugs is a boolean; if true the automated bug closing feature of +dinstall is activated. + +SpecialAcceptedAutoBuild is a boolean; if true it activates support +for auto-building from accepted. + +OverrideMaintainer can be used to globally override the +__MAINTAINER_TO__ and __MAINTAINER_FROM__ variables in template mails. +Use with caution. + +SkipTime is an integer value which is the number of seconds that a +file must be older than (via it's last modified timestamp) before +jennifer will REJECT rather than SKIP the package. ================================================================================ diff --git a/docs/katie.1.sgml b/docs/katie.1.sgml index 8ea23bf0..ab0e6512 100644 --- a/docs/katie.1.sgml +++ b/docs/katie.1.sgml @@ -17,7 +17,7 @@ katie - Installs packages from incoming + Installs packages from accepted @@ -25,14 +25,14 @@ katie - package + changes_file Description</> <para> - <command>katie</command> is the program which installs packages from incoming into the distribution. + <command>katie</command> is the program which installs packages from the accepted directory into the distribution. </PARA></REFSECT1> <RefSect1><Title>Options</> @@ -53,13 +53,6 @@ </listitem> </varlistentry> - <varlistentry> - <term><option>-k/--ack-new</option></term> - <listitem> - <para>Acknowledge new packages. <emphasis>WARNING:</emphasis> due to the sub-optimal implementation of new packages, this option should only be used when processing *all* packages (e.g. in cron jobs).</para> - </listitem> - </varlistentry> - <varlistentry> <term><option>-m/--manual-reject=<replaceable>message</replaceable></option></term> <listitem> @@ -81,13 +74,6 @@ </listitem> </varlistentry> - <varlistentry> - <term><option>-u/--distribution=<replaceable>distribution</replaceable></option></term> - <listitem> - <para>Override the <literal>Distribution</Literal> field. Should only be used for binary packages otherwise if used on a source package, all binary recompiles of that source will require a similar manual override.</para> - </listitem> - </varlistentry> - <varlistentry> <term><option>-v/--version</option></term> <listitem> diff --git a/docs/natalie.1.sgml b/docs/natalie.1.sgml index 388f6f26..cc5526df 100644 --- a/docs/natalie.1.sgml +++ b/docs/natalie.1.sgml @@ -8,12 +8,12 @@ <refentry> &katie-docinfo; - + <refmeta> <refentrytitle>natalie</> <manvolnum>1</> </refmeta> - + <!-- Man page title --> <refnamediv> <refname>natalie</> @@ -27,18 +27,25 @@ <arg><option><replaceable>options</replaceable></></arg> </cmdsynopsis> </refsynopsisdiv> - + <RefSect1><Title>Description</> - <para> + <para> <command>natalie</command> is the command line tool to handle override files. Override files can be listed to stdout or updated from stdin. <RefSect1><Title>Options</> - + <VariableList> <VarListEntry><term><option>-c/--component=<replaceable>component</replaceable></option></> <ListItem><Para>Uses the override DB for the component listed. The default is <literal>main</literal>.</PARA></LISTITEM> </VarListEntry> - + + <varlistentry> + <term><option>-h/--help</option></term> + <listitem> + <para>Display usage help and then exit.</para> + </listitem> + </varlistentry> + <varlistentry> <term><option>-l/--list</option></term> <listitem> @@ -46,14 +53,21 @@ </listitem> </varlistentry> + <varlistentry> + <term><option>-q/--quiet</option></term> + <listitem> + <para>Be less verbose about what has been done.</para> + </listitem> + </varlistentry> + <VarListEntry><term><option>-s/--suite=<replaceable>suite</replaceable></option></> <ListItem><Para>Uses the override DB for the suite listed. The default is <literal>unstable</literal>.</PARA></LISTITEM> </VarListEntry> - + <VarListEntry><term><option>-S/--set</option></term> <ListItem><Para>Update the override DB based on the contents of stdin. Information on the results of the update are printed to stdout.</PARA></LISTITEM> </VarListEntry> - + <varlistentry> <term><option>-t/--type=<replaceable>type</replaceable></option></term> <listitem> @@ -70,5 +84,5 @@ </RefSect1> &manauthor; - + </refentry> -- 2.39.5 From d889e5903fc6da2f7ba081dca17c457a20db5fa0 Mon Sep 17 00:00:00 2001 From: James Troup <james@nocrew.org> Date: Wed, 8 May 2002 11:09:02 +0000 Subject: [PATCH 09/16] natalie got renamed --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 8f183a24..c7e4e71f 100755 --- a/debian/rules +++ b/debian/rules @@ -32,7 +32,7 @@ binary-indep: checkroot build install -d debian/tmp/usr/bin/ install -m 755 andrea catherine charisma denise fernanda \ - heidi jenna julia katie madison melanie natalie.py neve \ + heidi jenna julia katie madison melanie natalie neve \ rene rhona shania tea ziyi debian/tmp/usr/bin/ # Compatability symlinks for people using old debs @@ -45,7 +45,7 @@ binary-indep: checkroot build ln -s neve debian/tmp/usr/bin/da_populate ln -s rhona debian/tmp/usr/bin/da_clean ln -s madison debian/tmp/usr/bin/da_chkver - ln -s natalie.py debian/tmp/usr/bin/da_override + ln -s natalie debian/tmp/usr/bin/da_override ln -s melanie debian/tmp/usr/bin/da_remove ln -s ziyi debian/tmp/usr/bin/da_mkrelease -- 2.39.5 From 8ecf66b7d933929ca5f504a32fb54542b0b87b71 Mon Sep 17 00:00:00 2001 From: James Troup <james@nocrew.org> Date: Wed, 8 May 2002 11:13:02 +0000 Subject: [PATCH 10/16] Dir rationalization --- catherine | 6 +++--- claire.py | 14 +++++++------- denise | 10 ++++------ halle | 6 +++--- jenna | 10 +++++----- jeri | 10 +++++----- lisa | 10 +++++----- melanie | 8 ++++---- rene | 10 ++++++---- shania | 6 +++--- tea | 10 +++++----- 11 files changed, 50 insertions(+), 50 deletions(-) diff --git a/catherine b/catherine index 25d43de2..80ff5b72 100755 --- a/catherine +++ b/catherine @@ -1,8 +1,8 @@ #!/usr/bin/env python # Poolify (move packages from "legacy" type locations to pool locations) -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: catherine,v 1.15 2001-11-19 02:02:53 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: catherine,v 1.16 2002-05-08 11:13:02 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 @@ -114,7 +114,7 @@ def poolize (q, limit, verbose, no_action): # First move the files to the new location pool_location = utils.poolify (source, component); pool_filename = pool_location + destination_filename; - destination = Cnf["Dir::PoolDir"] + pool_location + destination_filename; + destination = Cnf["Dir::Pool"] + pool_location + destination_filename; if os.path.exists(destination): utils.fubar("'%s' already exists in the pool; serious FUBARity." % (legacy_filename)); if verbose: diff --git a/claire.py b/claire.py index d0d82d06..cf47f172 100755 --- a/claire.py +++ b/claire.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # 'Fix' stable to make debian-cd and dpkg -BORGiE users happy -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: claire.py,v 1.12 2001-11-19 20:42:40 rmurray Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: claire.py,v 1.13 2002-05-08 11:13:02 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 @@ -104,8 +104,8 @@ UNION SELECT DISTINCT ON (f.id) null, sec.section, l.path, f.filename, f.id for i in q.getresult(): src = i[2]+i[3] (component, section) = fix_component_section(i[0], i[1]); - dest = "%sdists/%s/%s/source/%s%s" % (Cnf["Dir::RootDir"], Cnf.get("Suite::Stable::CodeName", "stable"), component, section, os.path.basename(i[3])); - src = clean_symlink(src, dest, Cnf["Dir::RootDir"]); + dest = "%sdists/%s/%s/source/%s%s" % (Cnf["Dir::Root"], Cnf.get("Suite::Stable::CodeName", "stable"), component, section, os.path.basename(i[3])); + src = clean_symlink(src, dest, Cnf["Dir::Root"]); if not os.path.exists(dest): if Cnf.Find("Claire::Options::Verbose"): print src+' -> '+dest @@ -143,8 +143,8 @@ UNION SELECT DISTINCT ON (f.id) null, a.arch_string, sec.section, b.package, version = utils.re_no_epoch.sub('', i[4]); src = i[5]+i[6] - dest = "%sdists/%s/%s/binary-%s/%s%s_%s.deb" % (Cnf["Dir::RootDir"], Cnf.get("Suite::Stable::CodeName", "stable"), component, architecture, section, package, version); - src = clean_symlink(src, dest, Cnf["Dir::RootDir"]); + dest = "%sdists/%s/%s/binary-%s/%s%s_%s.deb" % (Cnf["Dir::Root"], Cnf.get("Suite::Stable::CodeName", "stable"), component, architecture, section, package, version); + src = clean_symlink(src, dest, Cnf["Dir::Root"]); if not os.path.exists(dest): if Cnf.Find("Claire::Options::Verbose"): print src+' -> '+dest @@ -153,7 +153,7 @@ UNION SELECT DISTINCT ON (f.id) null, a.arch_string, sec.section, b.package, # Add per-arch symlinks for arch: all debs if architecture == "all": for arch in architectures: - dest = "%sdists/%s/%s/binary-%s/%s%s_%s.deb" % (Cnf["Dir::RootDir"], Cnf.get("Suite::Stable::CodeName", "stable"), component, arch, section, package, version); + dest = "%sdists/%s/%s/binary-%s/%s%s_%s.deb" % (Cnf["Dir::Root"], Cnf.get("Suite::Stable::CodeName", "stable"), component, arch, section, package, version); if not os.path.exists(dest): if Cnf.Find("Claire::Options::Verbose"): print src+' -> '+dest diff --git a/denise b/denise index b17dad05..a1349357 100755 --- a/denise +++ b/denise @@ -1,8 +1,8 @@ #!/usr/bin/env python # Output override files for apt-ftparchive and indices/ -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: denise,v 1.9 2001-11-18 19:57:58 rmurray Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: denise,v 1.10 2002-05-08 11:13:02 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 @@ -25,7 +25,7 @@ ################################################################################ import pg, sys, string -import utils, db_access, natalie +import utils, db_access import apt_pkg; ################################################################################ @@ -84,8 +84,6 @@ def main (): projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); db_access.init(Cnf, projectB); - natalie.init(); - for suite in [ "stable", "unstable" ]: sys.stderr.write("Processing %s...\n" % (suite)); override_suite = Cnf["Suite::%s::OverrideCodeName" % (suite)]; @@ -101,7 +99,7 @@ def main (): override_type = ".debian-installer"; elif type == "dsc": override_type = ".src"; - filename = "%s/override.%s.%s%s" % (Cnf["Dir::OverrideDir"], override_suite, string.replace(component, "non-US/", ""), override_type); + filename = "%s/override.%s.%s%s" % (Cnf["Dir::Override"], override_suite, string.replace(component, "non-US/", ""), override_type); file = utils.open_file(filename, 'w'); sys.stdout = file; list(suite, component, type); diff --git a/halle b/halle index 1a16ffe0..e3ad2882 100755 --- a/halle +++ b/halle @@ -1,8 +1,8 @@ #!/usr/bin/env python # Remove obsolete .changes files from proposed-updates -# Copyright (C) 2001 James Troup <james@nocrew.org> -# $Id: halle,v 1.5 2002-03-31 16:14:42 troup Exp $ +# Copyright (C) 2001, 2002 James Troup <james@nocrew.org> +# $Id: halle,v 1.6 2002-05-08 11:13:02 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 @@ -108,7 +108,7 @@ def check_joey (filename): file = utils.open_file(filename); cwd = os.getcwd(); - os.chdir("%s/dists/proposed-updates" % (Cnf["Dir::RootDir"])); + os.chdir("%s/dists/proposed-updates" % (Cnf["Dir::Root"])); for line in file.readlines(): line = line[:-1]; diff --git a/jenna b/jenna index 73fdf0cf..e388ca1b 100755 --- a/jenna +++ b/jenna @@ -1,8 +1,8 @@ #!/usr/bin/env python # Generate file list which is then fed to apt-ftparchive to generate Packages and Sources files -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: jenna,v 1.15 2001-11-18 19:57:58 rmurray Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: jenna,v 1.16 2002-05-08 11:13:02 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 @@ -264,17 +264,17 @@ def main(): continue if architecture == "source": Logger.log(["Processing dists/%s/%s/%s..." % (suite, component, architecture)]); - output = utils.open_file("%s/%s_%s_%s.list" % (Cnf["Dir::ListsDir"], suite, component, architecture), "w") + output = utils.open_file("%s/%s_%s_%s.list" % (Cnf["Dir::Lists"], suite, component, architecture), "w") generate_src_list(suite, component, output, dislocated_files); output.close(); else: Logger.log(["Processing dists/%s/%s/binary-%s..." % (suite, component, architecture)]); - output = utils.open_file("%s/%s_%s_binary-%s.list" % (Cnf["Dir::ListsDir"], suite, component, architecture), "w"); + output = utils.open_file("%s/%s_%s_binary-%s.list" % (Cnf["Dir::Lists"], suite, component, architecture), "w"); generate_bin_list(suite, component, architecture, output, "deb", dislocated_files); output.close(); if component == "main" and (suite == "unstable" or suite == "testing") and Cnf.has_key("Section::debian-installer"): # FIXME: must be a cleaner way to say debian-installer is main only? Logger.log(["Processing dists/%s/%s/debian-installer/binary-%s..." % (suite,component, architecture)]); - output = utils.open_file("%s/%s_%s_debian-installer_binary-%s.list" % (Cnf["Dir::ListsDir"], suite, component, architecture), "w"); + output = utils.open_file("%s/%s_%s_debian-installer_binary-%s.list" % (Cnf["Dir::Lists"], suite, component, architecture), "w"); generate_bin_list(suite, component, architecture, output, "udeb", dislocated_files); output.close(); Logger.close(); diff --git a/jeri b/jeri index f8b97c28..ce69162d 100755 --- a/jeri +++ b/jeri @@ -1,8 +1,8 @@ #!/usr/bin/env python # Dependency check proposed-updates -# Copyright (C) 2001 James Troup <james@nocrew.org> -# $Id: jeri,v 1.4 2002-02-12 22:12:44 troup Exp $ +# Copyright (C) 2001, 2002 James Troup <james@nocrew.org> +# $Id: jeri,v 1.5 2002-05-08 11:13:02 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 @@ -198,7 +198,7 @@ def check_changes (filename): # Move to the pool directory cwd = os.getcwd(); file = files.keys()[0]; - pool_dir = Cnf["Dir::PoolDir"] + '/' + utils.poolify(changes["source"], files[file]["component"]); + pool_dir = Cnf["Dir::Pool"] + '/' + utils.poolify(changes["source"], files[file]["component"]); os.chdir(pool_dir); changes_result = 0; @@ -227,7 +227,7 @@ def check_joey (filename): file = utils.open_file(filename); cwd = os.getcwd(); - os.chdir("%s/dists/proposed-updates" % (Cnf["Dir::RootDir"])); + os.chdir("%s/dists/proposed-updates" % (Cnf["Dir::Root"])); for line in file.readlines(): line = line[:-1]; @@ -260,7 +260,7 @@ def parse_packages(): architectures.remove(arch); for component in components: for architecture in architectures: - filename = "%s/dists/%s/%s/binary-%s/Packages" % (Cnf["Dir::RootDir"], suite, component, architecture); + filename = "%s/dists/%s/%s/binary-%s/Packages" % (Cnf["Dir::Root"], suite, component, architecture); packages = utils.open_file(filename, 'r'); Packages = apt_pkg.ParseTagFile(packages); while Packages.Step(): diff --git a/lisa b/lisa index e17666e8..04491286 100755 --- a/lisa +++ b/lisa @@ -1,8 +1,8 @@ #!/usr/bin/env python # Handles NEW and BYHAND packages -# Copyright (C) 2001 James Troup <james@nocrew.org> -# $Id: lisa,v 1.8 2002-04-21 15:38:54 troup Exp $ +# Copyright (C) 2001, 2002 James Troup <james@nocrew.org> +# $Id: lisa,v 1.9 2002-05-08 11:13:02 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 @@ -58,7 +58,7 @@ import apt_pkg, apt_inst; import db_access, fernanda, katie, logging, utils; # Globals -lisa_version = "$Revision: 1.8 $"; +lisa_version = "$Revision: 1.9 $"; Cnf = None; Options = None; @@ -485,7 +485,7 @@ def do_bxa_notification(): summary = summary + "Package: %s\n" % (control.Find("Package")); summary = summary + "Description: %s\n" % (control.Find("Description")); Katie.Subst["__BINARY_DESCRIPTIONS__"] = summary; - bxa_mail = utils.TemplateSubst(Katie.Subst,open(Cnf["Dir::TemplatesDir"]+"/lisa.bxa_notification","r").read()); + bxa_mail = utils.TemplateSubst(Katie.Subst,Cnf["Dir::Templates"]+"/lisa.bxa_notification"); utils.send_mail(bxa_mail,""); ################################################################################ @@ -510,7 +510,7 @@ def add_overrides (new): projectB.query("COMMIT WORK"); - if Cnf.FindI("Dinstall::BXANotify"): + if Cnf.FindB("Dinstall::BXANotify"): do_bxa_notification(); ################################################################################ diff --git a/melanie b/melanie index 479b91e1..a0b7485c 100755 --- a/melanie +++ b/melanie @@ -1,8 +1,8 @@ #!/usr/bin/env python # General purpose package removal tool for ftpmaster -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: melanie,v 1.23 2002-02-22 02:19:26 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: melanie,v 1.24 2002-05-08 11:13:02 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 @@ -394,7 +394,7 @@ def main (): Subst["__BCC__"] = "Bcc: " + string.join(bcc, ", "); else: Subst["__BCC__"] = "X-Filler: 42"; - Subst["__CC__"] = "X-Melanie: $Revision: 1.23 $"; + Subst["__CC__"] = "X-Melanie: $Revision: 1.24 $"; if carbon_copy: Subst["__CC__"] = Subst["__CC__"] + "\nCc: " + string.join(carbon_copy, ", "); Subst["__SUITE_LIST__"] = suites_list; @@ -408,7 +408,7 @@ def main (): Subst["__PRIMARY_MIRROR__"] = Archive["PrimaryMirror"]; for bug in string.split(Options["Done"]): Subst["__BUG_NUMBER__"] = bug; - mail_message = utils.TemplateSubst(Subst,open(Cnf["Dir::TemplatesDir"]+"/melanie.bug-close","r").read()); + mail_message = utils.TemplateSubst(Subst,Cnf["Dir::TemplatesDir"]+"/melanie.bug-close"); utils.send_mail (mail_message, "") logfile.write("=========================================================================\n"); diff --git a/rene b/rene index 0d266ae2..3f1b9d1e 100755 --- a/rene +++ b/rene @@ -1,8 +1,8 @@ #!/usr/bin/env python # Check for obsolete binary packages -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: rene,v 1.10 2002-02-12 23:14:30 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: rene,v 1.11 2002-05-08 11:13:02 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 @@ -18,6 +18,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +################################################################################ + # "Welcome to where time stands still, # No one leaves and no one will." # - Sanitarium - Metallica / Master of the puppets @@ -60,7 +62,7 @@ def main (): components = Cnf.SubTree("Suite::%s::Components" % (suite)).List(); for component in components: - filename = "%s/dists/%s/%s/source/Sources.gz" % (Cnf["Dir::RootDir"], suite, component); + filename = "%s/dists/%s/%s/source/Sources.gz" % (Cnf["Dir::Root"], suite, component); # apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance... temp_filename = tempfile.mktemp(); fd = os.open(temp_filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700); @@ -134,7 +136,7 @@ def main (): for architecture in architectures: if [ "source", "all" ].count(architecture) != 0: continue; - filename = "%s/dists/%s/%s/binary-%s/Packages" % (Cnf["Dir::RootDir"], suite, component, architecture); + filename = "%s/dists/%s/%s/binary-%s/Packages" % (Cnf["Dir::Root"], suite, component, architecture); packages = utils.open_file(filename); Packages = apt_pkg.ParseTagFile(packages); while Packages.Step(): diff --git a/shania b/shania index e3423d68..6131cbc6 100755 --- a/shania +++ b/shania @@ -1,8 +1,8 @@ #!/usr/bin/env python # Clean incoming of old unused files -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: shania,v 1.13 2002-03-14 14:12:04 ajt Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: shania,v 1.14 2002-05-08 11:13:02 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 @@ -81,7 +81,7 @@ def init (): # Move to the directory to clean incoming = Options["Incoming"]; if incoming == "": - incoming = Cnf["Dir::IncomingDir"]; + incoming = Cnf["Dir::Queue::Unchecked"]; os.chdir(incoming); # Remove a file to the morgue diff --git a/tea b/tea index 37834324..b6a28095 100755 --- a/tea +++ b/tea @@ -1,8 +1,8 @@ #!/usr/bin/env python # Sanity check the database -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: tea,v 1.17 2002-04-16 14:47:19 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: tea,v 1.18 2002-05-08 11:13:02 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 @@ -74,14 +74,14 @@ def check_files(): if os.access(filename, os.R_OK) == 0: utils.warn("'%s' doesn't exist." % (filename)); - file = utils.open_file(Cnf["Dir::OverrideDir"]+'override.unreferenced'); + file = utils.open_file(Cnf["Dir::Override"]+'override.unreferenced'); for filename in file.readlines(): filename = filename[:-1]; excluded[filename] = ""; print "Checking against existent files..."; - os.path.walk(Cnf["Dir::RootDir"]+'dists/', process_dir, None); + os.path.walk(Cnf["Dir::Root"]+'dists/', process_dir, None); print print "%s wasted..." % (utils.size_type(waste)); @@ -95,7 +95,7 @@ def check_dscs(): if component == "mixed": continue; component = string.lower(component); - list_filename = '%s%s_%s_source.list' % (Cnf["Dir::ListsDir"], suite, component); + list_filename = '%s%s_%s_source.list' % (Cnf["Dir::Lists"], suite, component); list_file = utils.open_file(list_filename); for line in list_file.readlines(): file = line[:-1]; -- 2.39.5 From e12d3c61f4b517e6cdb869e6001cf748a396365d Mon Sep 17 00:00:00 2001 From: James Troup <james@nocrew.org> Date: Wed, 8 May 2002 11:13:30 +0000 Subject: [PATCH 11/16] FindB, not FindI --- rhona | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rhona b/rhona index 83f3da44..7033a23e 100755 --- a/rhona +++ b/rhona @@ -1,8 +1,8 @@ #!/usr/bin/env python # rhona, cleans up unassociated binary and source packages -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: rhona,v 1.22 2002-04-24 01:56:24 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: rhona,v 1.23 2002-05-08 11:13:30 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 @@ -288,7 +288,7 @@ SELECT f.id FROM fingerprint f def clean_accepted_autobuild(): global now_date; - if not Cnf.get("Dinstall::SpecialAcceptedAutoBuild") or Options["No-Action"]: + if not Cnf.FindB("Dinstall::SpecialAcceptedAutoBuild") or Options["No-Action"]: return; print "Cleaning out accepted autobuild symlinks..." -- 2.39.5 From 74e5546af6a3dc2b7cbcc25ce78f21b077459bee Mon Sep 17 00:00:00 2001 From: James Troup <james@nocrew.org> Date: Wed, 8 May 2002 11:13:37 +0000 Subject: [PATCH 12/16] sync --- vars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars b/vars index 00154b28..fae916bf 100644 --- a/vars +++ b/vars @@ -4,7 +4,7 @@ base=/org/ftp.debian.org ftpdir=$base/ftp webdir=$base/web indices=$ftpdir/indices -archs="alpha arm hppa hurd-i386 i386 ia64 m68k powerpc sparc mips mipsel sh s390" +archs="alpha arm hppa hurd-i386 i386 ia64 m68k powerpc s390 sparc mips mipsel sh" scriptdir=$base/scripts masterdir=$base/katie/ -- 2.39.5 From 08d80b7669f2aef2dc031c1378312446be8b3b1e Mon Sep 17 00:00:00 2001 From: James Troup <james@nocrew.org> Date: Wed, 8 May 2002 11:13:44 +0000 Subject: [PATCH 13/16] templatesubst opens and closes the file itself --- utils.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/utils.py b/utils.py index 43da8396..81454d44 100644 --- a/utils.py +++ b/utils.py @@ -1,6 +1,6 @@ # Utility functions -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: utils.py,v 1.41 2002-04-21 15:39:06 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: utils.py,v 1.42 2002-05-08 11:13:44 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 @@ -379,10 +379,13 @@ def regex_safe (s): ###################################################################################### # Perform a substition of template -def TemplateSubst(Map,Template): - for x in Map.keys(): - Template = string.replace(Template,x,Map[x]); - return Template; +def TemplateSubst(map,filename): + file = open_file(filename); + template = file.read(); + for x in map.keys(): + template = string.replace(template,x,map[x]); + file.close(); + return template; ###################################################################################### -- 2.39.5 From 0dfef9ed33b71181a6d263d9d8cdffe6e12bfc41 Mon Sep 17 00:00:00 2001 From: James Troup <james@nocrew.org> Date: Wed, 8 May 2002 11:14:06 +0000 Subject: [PATCH 14/16] postgres.h moved --- sql-aptvc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-aptvc.cpp b/sql-aptvc.cpp index 54ba9e92..6f14ee64 100644 --- a/sql-aptvc.cpp +++ b/sql-aptvc.cpp @@ -25,7 +25,7 @@ extern "C" { -#include <postgres.h> +#include <server/postgres.h> int versioncmp(text *A, text *B); -- 2.39.5 From f22f57084bb5a6c4b30cd2dfcd138c9976db7fbf Mon Sep 17 00:00:00 2001 From: James Troup <james@nocrew.org> Date: Wed, 8 May 2002 11:15:38 +0000 Subject: [PATCH 15/16] natalie moved to .py-less name --- natalie.py => natalie | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) rename natalie.py => natalie (91%) diff --git a/natalie.py b/natalie similarity index 91% rename from natalie.py rename to natalie index 8fc1c0d9..74b59f80 100755 --- a/natalie.py +++ b/natalie @@ -1,8 +1,8 @@ #!/usr/bin/env python # Manipulate override files -# Copyright (C) 2000, 2001 James Troup <james@nocrew.org> -# $Id: natalie.py,v 1.15 2002-02-12 22:14:38 troup Exp $ +# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> +# $Id: natalie,v 1.1 2002-05-08 11:15:38 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 @@ -35,26 +35,24 @@ Logger = None; def usage (exit_code=0): print """Usage: natalie.py [OPTIONS] -h, --help this help + -c, --component=CMPT list/set overrides by component (contrib,*main,non-free) -s, --suite=SUITE list/set overrides by suite (experimental,stable,testing,*unstable) -t, --type=TYPE list/set overrides by type (*deb,dsc,udeb) + -S, --set set overrides from stdin -l, --list list overrides on stdout + -q, --quiet be less verbose + starred (*) values are default""" sys.exit(exit_code) ################################################################################ -def init (): - global projectB; - - projectB = pg.connect('projectb', None); - db_access.init(Cnf, projectB); - def process_file (file, suite, component, type): suite_id = db_access.get_suite_id(suite); if suite_id == -1: @@ -173,7 +171,8 @@ def process_file (file, suite, component, type): Logger.log(["removed override",suite,component,type,package]); projectB.query("COMMIT WORK"); - print "Done in %d seconds. [Updated = %d, Added = %d, Removed = %d, Skipped = %d, Errors = %d]" % (int(time.time()-start_time), c_updated, c_added, c_removed, c_skipped, c_error); + if not Cnf["Natalie::Options::Quiet"]: + print "Done in %d seconds. [Updated = %d, Added = %d, Removed = %d, Skipped = %d, Errors = %d]" % (int(time.time()-start_time), c_updated, c_added, c_removed, c_skipped, c_error); Logger.log(["set complete",c_updated, c_added, c_removed, c_skipped, c_error]); ################################################################################ @@ -205,16 +204,17 @@ def list(suite, component, type): def main (): global Cnf, projectB, Logger; - Cnf = utils.get_conf() - Arguments = [('h',"help","Natalie::Options::Help"), - ('c',"component", "Natalie::Options::Component", "HasArg"), - ('l',"list", "Natalie::Options::List"), - ('s',"suite","Natalie::Options::Suite", "HasArg"), - ('S',"set","Natalie::Options::Set"), - ('t',"type","Natalie::Options::Type", "HasArg")]; + Cnf = utils.get_conf(); + Arguments = [('h', "help", "Natalie::Options::Help"), + ('c', "component", "Natalie::Options::Component", "HasArg"), + ('l', "list", "Natalie::Options::List"), + ('q', "quiet", "Natalie::Options::Quiet"), + ('s', "suite", "Natalie::Options::Suite", "HasArg"), + ('S', "set", "Natalie::Options::Set"), + ('t', "type", "Natalie::Options::Type", "HasArg")]; # Default arguments - for i in ["help", "list", "set" ]: + for i in ["help", "list", "quiet", "set" ]: if not Cnf.has_key("Natalie::Options::%s" % (i)): Cnf["Natalie::Options::%s" % (i)] = ""; if not Cnf.has_key("Natalie::Options::Component"): @@ -229,7 +229,8 @@ def main (): if Cnf["Natalie::Options::Help"]: usage(); - init(); + projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); + db_access.init(Cnf, projectB); action = None; for i in [ "list", "set" ]: -- 2.39.5 From 475b8103bcbb729b2c20af803dea36cd9a123f50 Mon Sep 17 00:00:00 2001 From: James Troup <james@nocrew.org> Date: Wed, 8 May 2002 11:17:45 +0000 Subject: [PATCH 16/16] dir rationlization --- logging.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/logging.py b/logging.py index 5aba74df..1952ca9f 100644 --- a/logging.py +++ b/logging.py @@ -1,6 +1,6 @@ # Logging functions -# Copyright (C) 2001 James Troup <james@nocrew.org> -# $Id: logging.py,v 1.1 2001-07-07 03:59:45 troup Exp $ +# Copyright (C) 2001, 2002 James Troup <james@nocrew.org> +# $Id: logging.py,v 1.2 2002-05-08 11:17:45 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 @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + ################################################################################ import os, pwd, string, time @@ -34,7 +34,7 @@ class Logger: self.Cnf = Cnf; self.program = program; # Create the log directory if it doesn't exist - logdir = Cnf["Dir::LogDir"]; + logdir = Cnf["Dir::Log"]; if not os.path.exists(logdir): umask = os.umask(00000); os.makedirs(logdir, 02775); @@ -42,7 +42,7 @@ class Logger: logfilename = "%s/%s" % (logdir, time.strftime("%Y-%m", time.localtime(time.time()))); logfile = utils.open_file(logfilename, 'a'); # Seek to the end of the logfile - logfile.seek(0,2); + logfile.seek(0,2); self.logfile = logfile; # Log the start of the program user = pwd.getpwuid(os.getuid())[0]; -- 2.39.5