]> err.no Git - dak/commitdiff
move build queue cleaning to manage-build-queues
authorMark Hymers <mhy@debian.org>
Wed, 4 Nov 2009 21:42:43 +0000 (21:42 +0000)
committerMark Hymers <mhy@debian.org>
Wed, 4 Nov 2009 21:42:43 +0000 (21:42 +0000)
Signed-off-by: Mark Hymers <mhy@debian.org>
dak/clean_suites.py

index 0553b28db31c31567985ab1501706833bb0378a8..b8f04cc1a572f02a9d86d67b6d5e72c8d7efb391 100755 (executable)
@@ -357,41 +357,6 @@ SELECT f.id, f.fingerprint FROM fingerprint f
 
 ################################################################################
 
-def clean_queue_build(now_date, delete_date, max_delete, session):
-
-    cnf = Config()
-
-    if not cnf.ValueList("Dinstall::QueueBuildSuites") or Options["No-Action"]:
-        return
-
-    print "Cleaning out queue build symlinks..."
-
-    our_delete_date = now_date - timedelta(seconds = int(cnf["Clean-Suites::QueueBuildStayOfExecution"]))
-    count = 0
-
-    for qf in session.query(BuildQueueFile).filter(BuildQueueFile.last_used <= our_delete_date):
-        if not os.path.exists(qf.filename):
-            utils.warn("%s (from queue_build) doesn't exist." % (qf.filename))
-            continue
-
-        if not cnf.FindB("Dinstall::SecurityQueueBuild") and not os.path.islink(qf.filename):
-            utils.fubar("%s (from queue_build) should be a symlink but isn't." % (qf.filename))
-
-        Logger.log(["delete queue build", qf.filename])
-        if not Options["No-Action"]:
-            os.unlink(qf.filename)
-            session.delete(qf)
-        count += 1
-
-    if not Options["No-Action"]:
-        session.commit()
-
-    if count:
-        Logger.log(["total", count])
-        print "Cleaned %d queue_build files." % (count)
-
-################################################################################
-
 def clean_empty_directories(session):
     """
     Removes empty directories from pool directories.
@@ -463,7 +428,6 @@ def main():
     clean(now_date, delete_date, max_delete, session)
     clean_maintainers(now_date, delete_date, max_delete, session)
     clean_fingerprints(now_date, delete_date, max_delete, session)
-    clean_queue_build(now_date, delete_date, max_delete, session)
     clean_empty_directories(session)
 
     Logger.close()