]> err.no Git - dak/commitdiff
dak/export_suite.py: take archive file for the archive we are exporting from
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 4 Nov 2012 15:51:49 +0000 (16:51 +0100)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 4 Nov 2012 15:51:49 +0000 (16:51 +0100)
dak/export_suite.py
daklib/dbconn.py

index 03d118496bd408ef7cb6c5b5c27dcf82397a175e..1c22f5e5a80667f5dca78c6e411f4f09f4c26187 100644 (file)
@@ -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__':
index 08765171442890abb1cdaf415e5ee50fc3a250da..f2f8a9020ab7271c77e1aeddb8f765ea10424efd 100644 (file)
@@ -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