]> err.no Git - dak/commitdiff
dak/process_policy.py: Add option to copy accepted packages somewhere
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 4 Nov 2012 12:45:42 +0000 (13:45 +0100)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 4 Nov 2012 12:45:42 +0000 (13:45 +0100)
To sync packages accepted into the security archive to the main archive
we need to grab all accepted uploads. The right time to do so is when we
install them from the policy queue into the public archive, ie. in
process-policy.

dak/process_policy.py

index 8103fd0ba808453e8a63b02aaaa2cfd658648c68..db459607588971ae19c1b80b6dc04dd85b44560a 100755 (executable)
@@ -153,6 +153,26 @@ def comment_accept(upload, srcqueue, comments, transaction):
         dst = os.path.join(upload.target_suite.path, upload.changes.changesname)
         fs.copy(src, dst, mode=upload.target_suite.archive.mode)
 
+    # Copy upload to Process-Policy::CopyDir
+    # Used on security.d.o to sync accepted packages to ftp-master, but this
+    # should eventually be replaced by something else.
+    copydir = cnf.get('Process-Policy::CopyDir') or None
+    if copydir is not None:
+        mode = upload.target_suite.archive.mode
+        if upload.source is not None:
+            for f in [ df.poolfile for df in upload.source.srcfiles ]:
+                dst = os.path.join(copydir, f.basename)
+                fs.copy(f.fullpath, dst, mode=mode)
+
+        for db_binary in upload.binaries:
+            f = db_binary.poolfile
+            dst = os.path.join(copydir, f.basename)
+            fs.copy(f.fullpath, dst, mode=mode)
+
+        src = os.path.join(upload.policy_queue.path, upload.changes.changesname)
+        dst = os.path.join(copydir, upload.changes.changesname)
+        fs.copy(src, dst, mode=mode)
+
     if upload.source is not None and not Options['No-Action']:
         urgency = upload.changes.urgency
         if urgency not in cnf.value_list('Urgency::Valid'):