X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fsplit_done.py;h=87b38827706ac752a17afc91f7a629070f9c3a08;hb=580e881abd00bddf5e601dd1495bdafd7c3928ad;hp=0579f043f25f78d428a07f8084df7648bb1170af;hpb=096180b2f290fec40f73a7768bc95125cff38ba3;p=dak.git diff --git a/dak/split_done.py b/dak/split_done.py index 0579f043..87b38827 100755 --- a/dak/split_done.py +++ b/dak/split_done.py @@ -1,6 +1,8 @@ #!/usr/bin/env python +""" Split queue/done into date based subdirectories """ # Copyright (C) 2004, 2005, 2006 James Troup +# Copyright (C) 2008 Joerg Jaspert # 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 @@ -19,14 +21,14 @@ ################################################################################ import glob, os, stat, time -import daklib.utils +from daklib import utils ################################################################################ def main(): - Cnf = daklib.utils.get_conf() + Cnf = utils.get_conf() count = 0 - move_date = int(time.time())-(30*84600) + move_date = int(time.time()) os.chdir(Cnf["Dir::Queue::Done"]) files = glob.glob("%s/*" % (Cnf["Dir::Queue::Done"])) for filename in files: @@ -41,8 +43,9 @@ def main(): os.makedirs(dirname) dest = dirname + '/' + os.path.basename(filename) if os.path.exists(dest): - daklib.utils.fubar("%s already exists." % (dest)) - print "Move: %s -> %s" % (filename, dest) + utils.warn("%s already exists." % (dest)) + continue + print "Move: %s -> %s" % (filename, dest) os.rename(filename, dest) count = count + 1 print "Moved %d files." % (count)