]> err.no Git - dak/commitdiff
Don't remove sources which are referenced by other binaries
authorMark Hymers <mhy@debian.org>
Tue, 22 Mar 2011 10:56:55 +0000 (10:56 +0000)
committerMark Hymers <mhy@debian.org>
Tue, 22 Mar 2011 10:56:55 +0000 (10:56 +0000)
Signed-off-by: Mark Hymers <mhy@debian.org>
dak/clean_suites.py

index c6a0a77761a2f429363a176d6f16e69909d777c0..ab1e76d778be1e3f9e91e84c77c1624360fa8545 100755 (executable)
@@ -254,7 +254,8 @@ def clean(now_date, delete_date, max_delete, session):
     q = session.execute("""
 SELECT s.id, f.filename FROM source s, files f
   WHERE f.last_used <= :deletedate
-        AND s.file = f.id""", {'deletedate': delete_date})
+        AND s.file = f.id
+        AND s.id NOT IN (SELECT src_id FROM extra_src_references)""", {'deletedate': delete_date})
     for s in q.fetchall():
         Logger.log(["delete source", s[1], s[0]])
         if not Options["No-Action"]: