]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/archive.py: fix copying between components
authorAnsgar Burchardt <ansgar@debian.org>
Thu, 26 Sep 2013 07:13:44 +0000 (09:13 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Thu, 26 Sep 2013 07:13:44 +0000 (09:13 +0200)
The _copy_file() method needs to check if the file is already in the target
component. Having it in any component is not enough if it should be copied to
an additional component in the same archive.

daklib/archive.py

index e4804433be13afdb6cc5d18ac74a4ab5a40e477a..6071566cdfc66ed8ac6802616bd30c18a58d544c 100644 (file)
@@ -388,7 +388,7 @@ class ArchiveTransaction(object):
         """
         session = self.session
 
-        if session.query(ArchiveFile).filter_by(archive=archive, file=db_file).first() is None:
+        if session.query(ArchiveFile).filter_by(archive=archive, component=component, file=db_file).first() is None:
             query = session.query(ArchiveFile).filter_by(file=db_file)
             if not allow_tainted:
                 query = query.join(Archive).filter(Archive.tainted == False)