[dak/master] dak/export_suite.py: take archive file for the archive we are exporting from
---
dak/export_suite.py | 6 +++++-
daklib/dbconn.py | 4 +++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dak/export_suite.py b/dak/export_suite.py
index 03d1184..1c22f5e 100644
--- a/dak/export_suite.py
+++ b/dak/export_suite.py
@@ -76,9 +76,13 @@ def main(argv=None):
with FilesystemTransaction() as fs:
for f in files:
+ af = session.query(ArchiveFile) \
+ .join(ArchiveFile.component).join(ArchiveFile.file) \
+ .filter(ArchiveFile.archive == suite.archive) \
+ .filter(ArchiveFile.file == f).one()
dst = os.path.join(directory, f.basename)
if not os.path.exists(dst):
- fs.copy(f.fullpath, dst, symlink=symlink)
+ fs.copy(af.path, dst, symlink=symlink)
fs.commit()
if __name__ == '__main__':
diff --git a/daklib/dbconn.py b/daklib/dbconn.py
index 0876517..f2f8a90 100644
--- a/daklib/dbconn.py
+++ b/daklib/dbconn.py
@@ -1030,7 +1030,9 @@ class PoolFile(ORMObject):
@property
def fullpath(self):
session = DBConn().session().object_session(self)
- af = session.query(ArchiveFile).join(Archive).filter(ArchiveFile.file == self).first()
+ af = session.query(ArchiveFile).join(Archive) \
+ .filter(ArchiveFile.file == self) \
+ .order_by(Archive.tainted.desc()).first()
return af.path
@property
--
1.7.2.5
Reply to: