X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcheck_overrides.py;h=622067879f8cfa590077284062e4657aa4077df8;hb=515af446d70a85ddc0892d9f6e04f713f83b0ebb;hp=75ba5a0e2171b880cc412108f2abf1b0869d9eba;hpb=62d4f1c689acda0e1efeb3e571e519453bb4eb24;p=dak.git diff --git a/dak/check_overrides.py b/dak/check_overrides.py index 75ba5a0e..62206787 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 -# Copyright (C) 2005 Jeroen van Wolffelaar +""" Cruft checker and hole filler for overrides + +@contact: Debian FTPMaster +@copyright: 2000, 2001, 2002, 2004, 2006 James Troup +@opyright: 2005 Jeroen van Wolffelaar +@copyright: 2011 Joerg Jaspert +@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}) @@ -333,9 +341,9 @@ def main (): priorities[entry] = name if not Options["No-Action"]: - Logger = daklog.Logger(cnf, "check-overrides") + Logger = daklog.Logger("check-overrides") else: - Logger = daklog.Logger(cnf, "check-overrides", 1) + Logger = daklog.Logger("check-overrides", 1) for osuite in cnf.SubTree("Check-Overrides::OverrideSuites").List(): if "1" != cnf["Check-Overrides::OverrideSuites::%s::Process" % osuite]: @@ -361,17 +369,21 @@ def main (): if len(suiteids) < 1: utils.fubar("Couldn't find id's of all suites: %s" % suiteids) - for component in cnf.SubTree("Component").List(): + for component in session.query(Component).all(): # It is crucial for the dsc override creation based on binary # overrides that 'dsc' goes first - otypes = cnf.ValueList("OverrideType") - otypes.remove("dsc") - otypes = ["dsc"] + otypes + component_name = component.component_name + otypes = ['dsc'] + for ot in session.query(OverrideType): + if ot.overridetype == 'dsc': + continue + otypes.append(ot.overridetype) + for otype in otypes: print "Processing %s [%s - %s]" \ - % (osuite, component, otype) + % (osuite, component_name, otype) sys.stdout.flush() - process(osuite, suiteids, originosuite, component, otype, session) + process(osuite, suiteids, originosuite, component_name, otype, session) Logger.close()