]> git.decadent.org.uk Git - dak.git/blobdiff - dak/process_policy.py
Merge remote-tracking branch 'jcristau/cs-set-log-suite'
[dak.git] / dak / process_policy.py
index a4e6d875f033a889a856a06dff128109d3d6cc21..ab37aa2216b3282fcfeb4657d36944b89b32b3fc 100755 (executable)
@@ -49,6 +49,7 @@ from daklib.urgencylog import UrgencyLog
 from daklib.packagelist import PackageList
 
 import daklib.announce
+import daklib.utils
 
 # Globals
 Options = None
@@ -142,7 +143,7 @@ def comment_accept(upload, srcqueue, comments, transaction):
         return get_mapped_component(component_name, session=session)
 
     def is_debug_binary(db_binary):
-        return db_binary.proxy['Section'] == "debug"
+        return daklib.utils.is_in_debug_section(db_binary.proxy)
 
     def has_debug_binaries(upload):
         return any((is_debug_binary(x) for x in upload.binaries))
@@ -186,16 +187,6 @@ def comment_accept(upload, srcqueue, comments, transaction):
                 )
 
         for db_binary in upload.binaries:
-            # build queues may miss the source package if this is a
-            # binary-only upload.
-            if suite != upload.target_suite:
-                transaction.copy_source(
-                    db_binary.source,
-                    suite,
-                    source_component_func(db_binary.source),
-                    allow_tainted=allow_tainted,
-                )
-
             # Now, let's work out where to copy this guy to -- if it's
             # a debug binary, and the suite has a debug suite, let's go
             # ahead and target the debug suite rather then the stock
@@ -204,6 +195,16 @@ def comment_accept(upload, srcqueue, comments, transaction):
             if debug_suite is not None and is_debug_binary(db_binary):
                 copy_to_suite = debug_suite
 
+            # build queues and debug suites may miss the source package
+            # if this is a binary-only upload.
+            if copy_to_suite != upload.target_suite:
+                transaction.copy_source(
+                    db_binary.source,
+                    copy_to_suite,
+                    source_component_func(db_binary.source),
+                    allow_tainted=allow_tainted,
+                )
+
             transaction.copy_binary(
                 db_binary,
                 copy_to_suite,
@@ -212,6 +213,8 @@ def comment_accept(upload, srcqueue, comments, transaction):
                 extra_archives=[upload.target_suite.archive],
             )
 
+        suite.update_last_changed()
+
     # Copy .changes if needed
     if upload.target_suite.copychanges:
         src = os.path.join(upload.policy_queue.path, upload.changes.changesname)