From: James Troup Date: Sat, 20 Apr 2002 13:13:32 +0000 (+0000) Subject: auto-building from accepted support X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=dda108c5574d1bd377106a372b162244c9bd0ea5;p=dak.git auto-building from accepted support --- diff --git a/katie b/katie index 9c3cb807..133000f7 100755 --- a/katie +++ b/katie @@ -2,7 +2,7 @@ # Installs Debian packages # Copyright (C) 2000, 2001 James Troup -# $Id: katie,v 1.77 2002-04-02 01:03:53 troup Exp $ +# $Id: katie,v 1.78 2002-04-20 13:13:32 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.77 $"; +katie_version = "$Revision: 1.78 $"; Cnf = None; Options = None; @@ -388,6 +388,27 @@ 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"): + 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 + 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); + projectB.query("COMMIT WORK"); + install_count = install_count + 1; ################################################################################ @@ -468,7 +489,6 @@ def stable_install (summary, short_summary): utils.send_mail(mail_message, ""); Katie.announce(short_summary, 1) - # Finally remove the .katie file katie_file = os.path.join(Cnf["Suite::Proposed-Updates::CopyKatie"], os.path.basename(Katie.pkg.changes_file[:-8]+".katie")); os.unlink(katie_file); diff --git a/katie.py b/katie.py index d884ef01..8d31d653 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.12 2002-04-01 21:20:28 troup Exp $ +# $Id: katie.py,v 1.13 2002-04-20 13:13:32 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,6 +357,35 @@ 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"): + 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) + 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); + # If it doesn't exist, create a symlink + if not os.path.exists(dest): + # Find the .orig.tar.gz in the pool + q = self.projectB.query("SELECT l.path, f.filename from location l, files f WHERE f.id = %s" % (self.pkg.orig_tar_id)); + ql = q.getresult(); + if not ql: + 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); + self.projectB.query("COMMIT WORK"); + ########################################################################### def check_override (self):