From 2772454c0acdf26eb16bfb0c18ddfd4e5d229b05 Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Tue, 22 Mar 2011 10:56:55 +0000 Subject: [PATCH] Don't remove sources which are referenced by other binaries Signed-off-by: Mark Hymers --- dak/clean_suites.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"]: -- 2.39.5