From 4db39fc2fdceac5ddae30507a65f24b3fe694137 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Wed, 25 Sep 2013 23:58:55 +0200 Subject: [PATCH] daklib/archive.py: allow copying files between components 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 --- daklib/archive.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daklib/archive.py b/daklib/archive.py index 410e9cab..e4804433 100644 --- a/daklib/archive.py +++ b/daklib/archive.py @@ -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() -- 2.39.5