From: Ansgar Burchardt Date: Wed, 25 Sep 2013 21:58:55 +0000 (+0200) Subject: daklib/archive.py: allow copying files between components X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=4db39fc2fdceac5ddae30507a65f24b3fe694137;p=dak.git 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 --- 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()