]> git.decadent.org.uk Git - dak.git/blobdiff - katie
Fix jenna invocation
[dak.git] / katie
diff --git a/katie b/katie
index 27d909b7adf0028ce952ab56ea63deb21046dd6b..ad48fa0e5dcc9099fb85efb22ff8aa875398e5fd 100755 (executable)
--- a/katie
+++ b/katie
@@ -2,7 +2,7 @@
 
 # Installs Debian packages
 # Copyright (C) 2000, 2001, 2002  James Troup <james@nocrew.org>
-# $Id: katie,v 1.80 2002-05-08 11:52:31 troup Exp $
+# $Id: katie,v 1.84 2002-05-23 12:18: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.80 $";
+katie_version = "$Revision: 1.84 $";
 
 Cnf = None;
 Options = None;
@@ -118,19 +118,20 @@ def check():
                and not Katie.source_exists(source_package, source_version):
                 reject("no source found for %s %s (%s)." % (source_package, source_version, file));
 
+        # Version and file overwrite checks
+        if not installing_to_stable:
+            if files[file]["type"] == "deb":
+                reject(Katie.check_binary_against_db(file));
+            elif files[file]["type"] == "dsc":
+                reject(Katie.check_source_against_db(file));
+                (reject_msg, is_in_incoming) = Katie.check_dsc_against_db(file);
+                reject(reject_msg);
+
+        # Check the package is still in the override tables
         for suite in changes["distribution"].keys():
-            # Check the package is still in the override tables
             if not Katie.in_override_p(files[file]["package"], files[file]["component"], suite, files[file].get("dbtype",""), file):
                 reject("%s is NEW for %s." % (file, suite));
 
-            if not installing_to_stable:
-                if files[file]["type"] == "deb":
-                    reject(Katie.check_binaries_against_db(file, suite));
-                elif files[file]["type"] == "dsc":
-                    reject(Katie.check_source_against_db(file));
-                    (reject_msg, is_in_incoming) = Katie.check_dsc_against_db(file);
-                    reject(reject_msg);
-
 ###############################################################################
 
 def init():
@@ -390,29 +391,37 @@ def install ():
 
     # Undo the work done in katie.py(accept) to help auto-building
     # from accepted.
-    if Cnf.get("Dinstall::SpecialAcceptedAutoBuild") and \
-       changes["distribution"].has_key("unstable"):
+    projectB.query("BEGIN WORK");
+    for suite in changes["distribution"].keys():
+        if suite not in Cnf.ValueList("Dinstall::AcceptedAutoBuildSuites"):
+            continue;
         now_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()));
-        projectB.query("BEGIN WORK");
+        suite_id = db_access.get_suite_id(suite);
+        dest_dir = Cnf["Dir::AcceptedAutoBuild"];
+        if Cnf.FindB("Dinstall::SecurityAcceptedAutoBuild"):
+            dest_dir = os.path.join(dest_dir, suite);
         for file in files.keys():
-            dest = os.path.join(Cnf["Dir::AcceptedAutoBuild"], file);
+            dest = os.path.join(dest_dir, 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::Pool"], pool_location, os.path.basename(file));
-            os.unlink(dest);
-            os.symlink(src, dest);
+            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"):
+                # 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));
+                if os.path.islink(dest):
+                    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::AcceptedAutoBuild"], dsc_file);
+                    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 unstable_accepted SET in_accepted = 'f', last_used = '%s' WHERE filename = '%s'" % (now_date, orig_tar_gz));
-        projectB.query("COMMIT WORK");
+            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("COMMIT WORK");
 
+    # Finally...
     install_count = install_count + 1;
 
 ################################################################################