]> git.decadent.org.uk Git - dak.git/blobdiff - dak/process_unchecked.py
miscellaneous fixups from testing
[dak.git] / dak / process_unchecked.py
index 3a9f2ef2e226a828bacb4331af8dc2663c6033b1..fab21cbf4492a7d3bf4447e0dbf28be6c793e911 100755 (executable)
@@ -52,13 +52,14 @@ from debian_bundle import deb822
 from daklib.dbconn import *
 from daklib.binary import Binary
 from daklib import daklog
-from daklib import queue
+from daklib.queue import *
 from daklib import utils
 from daklib.textutils import fix_maintainer
 from daklib.dak_exceptions import *
 from daklib.regexes import re_default_answer
 from daklib.summarystats import SummaryStats
 from daklib.holding import Holding
+from daklib.config import Config
 
 from types import *
 
@@ -90,7 +91,7 @@ def init():
               "override-distribution", "version", "directory"]:
         cnf["Dinstall::Options::%s" % (i)] = ""
 
-    changes_files = apt_pkg.ParseCommandLine(cnf, Arguments, sys.argv)
+    changes_files = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
     Options = cnf.SubTree("Dinstall::Options")
 
     if Options["Help"]:
@@ -243,6 +244,7 @@ def package_to_queue(u, summary, short_summary, queue, perms=0660, build=True, a
     # Send accept mail, announce to lists and close bugs
     if announce and not cnf["Dinstall::Options::No-Mail"]:
         template = os.path.join(cnf["Dir::Templates"], announce)
+        u.update_subst()
         u.Subst["__SUITE__"] = ""
         mail_message = utils.TemplateSubst(u.Subst, template)
         utils.send_mail(mail_message)
@@ -431,9 +433,16 @@ def acknowledge_new(u, summary, short_summary):
 # the .changes file.
 
 def process_it(changes_file):
+    global Logger
+
     cnf = Config()
 
+    holding = Holding()
+
     u = Upload()
+    u.pkg.changes_file = changes_file
+    u.pkg.directory = os.getcwd()
+    u.logger = Logger
 
     # Some defaults in case we can't fully process the .changes file
     u.pkg.changes["maintainer2047"] = cnf["Dinstall::MyEmailAddress"]
@@ -463,18 +472,19 @@ def process_it(changes_file):
 
             # Absolutize the filename to avoid the requirement of being in the
             # same directory as the .changes file.
-            copy_to_holding(os.path.abspath(changes_file))
+            holding.copy_to_holding(os.path.abspath(changes_file))
 
             # Relativize the filename so we use the copy in holding
             # rather than the original...
             changespath = os.path.basename(u.pkg.changes_file)
 
-        changes["fingerprint"] = utils.check_signature(changespath, reject)
+        (u.pkg.changes["fingerprint"], rejects) = utils.check_signature(changespath)
 
-        if changes["fingerprint"]:
+        if u.pkg.changes["fingerprint"]:
             valid_changes_p = u.load_changes(changespath)
         else:
             valid_changes_p = False
+           u.rejects.extend(rejects)
 
         if valid_changes_p:
             while u.reprocess: