]> git.donarmstrong.com Git - dak.git/commitdiff
Merge remote-tracking branch 'ansgar/pu/multiarchive-1'
authorJoerg Jaspert <joerg@debian.org>
Tue, 14 Aug 2012 06:09:42 +0000 (08:09 +0200)
committerJoerg Jaspert <joerg@debian.org>
Tue, 14 Aug 2012 06:09:42 +0000 (08:09 +0200)
* ansgar/pu/multiarchive-1:
  daklib/archive.py: don't check hashes when copying upload to temporary location
  dak/clean_suites.py: use '>' instead of '>='
  daklib/utils.py (gpg_get_key_addresses): prefer @debian.org addresses
  dak/process_upload.py: remove old inactive code; update some comments
  dak/dakdb/update79.py: fix typo: workd → world

Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/process_new.py
daklib/queue.py

index 7a64277f23205d9bf8a2c4f611f5931c27f39f3b..8d4cd6bb6bc00fe03250b1266af7bd0162c94576 100755 (executable)
@@ -309,10 +309,13 @@ def edit_overrides (new, upload, session):
 
 ################################################################################
 
-def check_pkg (upload, upload_copy):
+def check_pkg (upload, upload_copy, session):
+    missing = []
     save_stdout = sys.stdout
     changes = os.path.join(upload_copy.directory, upload.changes.changesname)
     suite_name = upload.target_suite.suite_name
+    handler = PolicyQueueUploadHandler(upload, session)
+    missing = [(m['type'], m["package"]) for m in handler.missing_overrides(hints=missing)]
     try:
         sys.stdout = os.popen("less -R -", 'w', 0)
         print examine_package.display_changes(suite_name, changes)
@@ -324,7 +327,11 @@ def check_pkg (upload, upload_copy):
 
         for binary in upload.binaries:
             binary_file = os.path.join(upload_copy.directory, os.path.basename(binary.poolfile.filename))
-            print examine_package.check_deb(suite_name, binary_file)
+            examined = examine_package.check_deb(suite_name, binary_file)
+            # We always need to call check_deb to display package relations for every binary,
+            # but we print its output only if new overrides are being added.
+            if ("deb", binary.package) in missing:
+                print examined
 
         print examine_package.output_package_relations()
     except IOError as e:
@@ -520,23 +527,27 @@ def do_new(upload, upload_copy, handler, session):
                 print "Hello? Operator! Give me the number for 911!"
                 print "Dinstall in the locked area, cant process packages, come back later"
         elif answer == 'C':
-            check_pkg(upload, upload_copy)
+            check_pkg(upload, upload_copy, session)
         elif answer == 'E' and not Options["Trainee"]:
             missing = edit_overrides (missing, upload, session)
         elif answer == 'M' and not Options["Trainee"]:
             reason = Options.get('Manual-Reject', '') + "\n"
-            reason = reason + "\n".join(get_new_comments(upload.changes.source, session=session))
+            reason = reason + "\n".join([n.comment for n in get_new_comments(upload.changes.source, session=session)])
             reason = get_reject_reason(reason)
             if reason is not None:
                 Logger.log(["NEW REJECT", upload.changes.changesname])
                 handler.reject(reason)
                 done = True
         elif answer == 'N':
-            edit_note(get_new_comments(upload.changes.source, session=session),
-                      upload, session, bool(Options["Trainee"]))
+            if edit_note(get_new_comments(upload.changes.source, session=session),
+                         upload, session, bool(Options["Trainee"])) == 0:
+                end()
+                sys.exit(0)
         elif answer == 'P' and not Options["Trainee"]:
-            prod_maintainer(get_new_comments(upload.changes.source, session=session),
-                            upload)
+            if prod_maintainer(get_new_comments(upload.changes.source, session=session),
+                               upload) == 0:
+                end()
+                sys.exit(0)
             Logger.log(["NEW PROD", upload.changes.changesname])
         elif answer == 'R' and not Options["Trainee"]:
             confirm = utils.our_raw_input("Really clear note (y/N)? ").lower()
@@ -673,7 +684,7 @@ def show_new_comments(uploads, session):
                WHERE package IN :sources
                ORDER BY package, version"""
 
-    r = session.execute(query, params=dict(sources=sources))
+    r = session.execute(query, params=dict(sources=tuple(sources)))
 
     for i in r:
         print "%s_%s\n%s\n(%s)\n\n\n" % (i[0], i[1], i[2], i[3])
index 6f01ba6cbb0ea22472b2213ab35a9270008795ba..e81614c3e742e89a2b1b8c6538e8f65a712bcbe5 100644 (file)
@@ -132,8 +132,7 @@ def prod_maintainer(notes, upload):
     if answer == 'A':
         return
     elif answer == 'Q':
-        end()
-        sys.exit(0)
+        return 0
     # Otherwise, do the proding...
     user_email_address = utils.whoami() + " <%s>" % (
         cnf["Dinstall::MyAdminAddress"])
@@ -186,8 +185,7 @@ def edit_note(note, upload, session, trainee=False):
     if answer == 'A':
         return
     elif answer == 'Q':
-        end()
-        sys.exit(0)
+        return 0
 
     comment = NewComment()
     comment.package = upload.changes.source