From: Mark Hymers Date: Tue, 22 Mar 2011 10:56:55 +0000 (+0000) Subject: Don't remove sources which are referenced by other binaries X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2772454c0acdf26eb16bfb0c18ddfd4e5d229b05;p=dak Don't remove sources which are referenced by other binaries Signed-off-by: Mark Hymers --- diff --git a/dak/clean_suites.py b/dak/clean_suites.py index c6a0a777..ab1e76d7 100755 --- a/dak/clean_suites.py +++ b/dak/clean_suites.py @@ -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"]: