[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] dak/process_policy.py: don't try to copy files to accepted twice



We might already have copied files to accepted before, for example when
accepting multiple uploads that use the same upstream tarball. So we
have to ignore existing files here.
---
 dak/process_policy.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dak/process_policy.py b/dak/process_policy.py
index db45960..ab58cfe 100755
--- a/dak/process_policy.py
+++ b/dak/process_policy.py
@@ -162,16 +162,19 @@ def comment_accept(upload, srcqueue, comments, transaction):
         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)
+                if not os.path.exists(dst):
+                    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)
+            if not os.path.exists(dst):
+                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 not os.path.exists(dst):
+            fs.copy(src, dst, mode=mode)
 
     if upload.source is not None and not Options['No-Action']:
         urgency = upload.changes.urgency
-- 
1.7.2.5


Reply to: