]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/archive.py: allow copying files between components
authorAnsgar Burchardt <ansgar@debian.org>
Wed, 25 Sep 2013 21:58:55 +0000 (23:58 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Wed, 25 Sep 2013 21:58:55 +0000 (23:58 +0200)
Copying files between components is useful when a package moves between
components as otherwise the .changes would have to include the upstream
tarball (even if it did not change).

Signed-off-by: Ansgar Burchardt <ansgar@debian.org>
daklib/archive.py

index 410e9cabd7eabbcdc2d2ac243ed45faf0edc088f..e4804433be13afdb6cc5d18ac74a4ab5a40e477a 100644 (file)
@@ -388,14 +388,14 @@ class ArchiveTransaction(object):
         """
         session = self.session
 
-        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, component=component)
+        if session.query(ArchiveFile).filter_by(archive=archive, 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)
 
             source_af = query.first()
             if source_af is None:
-                raise ArchiveException('cp: Could not find {0} in component {1} in any archive.'.format(db_file.filename, component.component_name))
+                raise ArchiveException('cp: Could not find {0} in any archive.'.format(db_file.filename))
             target_af = ArchiveFile(archive, component, db_file)
             session.add(target_af)
             session.flush()