]> git.decadent.org.uk Git - dak.git/blobdiff - dak/clean_suites.py
Now it works :)
[dak.git] / dak / clean_suites.py
index b8f04cc1a572f02a9d86d67b6d5e72c8d7efb391..c6a0a77761a2f429363a176d6f16e69909d777c0 100755 (executable)
@@ -1,7 +1,13 @@
 #!/usr/bin/env python
 
-""" Cleans up unassociated binary and source packages """
-# Copyright (C) 2000, 2001, 2002, 2003, 2006  James Troup <james@nocrew.org>
+""" Cleans up unassociated binary and source packages
+
+@contact: Debian FTPMaster <ftpmaster@debian.org>
+@copyright: 2000, 2001, 2002, 2003, 2006  James Troup <james@nocrew.org>
+@copyright: 2009  Mark Hymers <mhy@debian.org>
+@copyright: 2010  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
 
 ################################################################################
 
-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(