[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] make check_overrides not delete stuff thats not at least 14 days old



Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
 dak/check_overrides.py |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/dak/check_overrides.py b/dak/check_overrides.py
index 75ba5a0..7c92464 100755
--- a/dak/check_overrides.py
+++ b/dak/check_overrides.py
@@ -1,8 +1,14 @@
 #!/usr/bin/env python
 
-""" Cruft checker and hole filler for overrides """
-# Copyright (C) 2000, 2001, 2002, 2004, 2006  James Troup <james@nocrew.org>
-# Copyright (C) 2005  Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+""" Cruft checker and hole filler for overrides
+
+@contact: Debian FTPMaster <ftpmaster@debian.org>
+@copyright: 2000, 2001, 2002, 2004, 2006  James Troup <james@nocrew.org>
+@opyright: 2005  Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+@copyright: 2011  Joerg Jaspert <joerg@debian.org>
+@license: GNU General Public License version 2 or later
+
+"""
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -58,8 +64,8 @@ from daklib import utils
 
 ################################################################################
 
-Options = None
-Logger = None
+Options = None                 #: Commandline arguments parsed into this
+Logger = None                  #: Our logging object
 sections = {}
 priorities = {}
 blacklist = {}
@@ -150,7 +156,8 @@ SELECT s.source FROM source s, src_associations sa, files f, location l,
                 if not Options["No-Action"]:
                     session.execute("""DELETE FROM override WHERE package = :package
                                           AND suite = :suite_id AND component = :component_id
-                                          AND type = :type_id""",
+                                          AND type = :type_id
+                                          AND created < now() - interval '14 days'""",
                                     {'package': package, 'suite_id': osuite_id,
                                      'component_id': component_id, 'type_id': type_id})
         # create source overrides based on binary overrides, as source
@@ -239,7 +246,8 @@ SELECT s.source FROM source s, src_associations sa, files f, location l,
                 if not Options["No-Action"]:
                     session.execute("""DELETE FROM override
                                         WHERE package = :package AND suite = :suite_id
-                                          AND component = :component_id AND type = :type_id""",
+                                          AND component = :component_id AND type = :type_id
+                                          AND created < now() - interval '14 days'""",
                                     {'package': package, 'suite_id': osuite_id,
                                      'component_id': component_id, 'type_id': type_id})
 
-- 
1.7.2.5


Reply to: