X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fclean_suites.py;h=c6a0a77761a2f429363a176d6f16e69909d777c0;hb=7f4d35fbb32109cc31edc50b054035e133e4bb52;hp=b8f04cc1a572f02a9d86d67b6d5e72c8d7efb391;hpb=e42248872acb35f7ca40395bd562b94026209215;p=dak.git diff --git a/dak/clean_suites.py b/dak/clean_suites.py index b8f04cc1..c6a0a777 100755 --- a/dak/clean_suites.py +++ b/dak/clean_suites.py @@ -1,7 +1,13 @@ #!/usr/bin/env python -""" Cleans up unassociated binary and source packages """ -# Copyright (C) 2000, 2001, 2002, 2003, 2006 James Troup +""" Cleans up unassociated binary and source packages + +@contact: Debian FTPMaster +@copyright: 2000, 2001, 2002, 2003, 2006 James Troup +@copyright: 2009 Mark Hymers +@copyright: 2010 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 @@ -28,7 +34,10 @@ ################################################################################ -import os, stat, sys, time +import os +import stat +import sys +import time import apt_pkg from datetime import datetime, timedelta @@ -237,7 +246,7 @@ def clean(now_date, delete_date, max_delete, session): cur_date = now_date.strftime("%Y-%m-%d") dest = os.path.join(cnf["Dir::Morgue"], cnf["Clean-Suites::MorgueSubDir"], cur_date) - if not os.path.exists(dest): + if not Options["No-Action"] and not os.path.exists(dest): os.mkdir(dest) # Delete from source @@ -362,6 +371,8 @@ def clean_empty_directories(session): Removes empty directories from pool directories. """ + print "Cleaning out empty directories..." + count = 0 cursor = session.execute(