# rhona, cleans up unassociated binary and source packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: rhona,v 1.14 2001-05-31 02:19:30 troup Exp $
+# $Id: rhona,v 1.15 2001-06-22 22:53:14 troup Exp $
# 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
Cnf = None
now_date = None; # mark newly "deleted" things as deleted "now"
delete_date = None; # delete things marked "deleted" earler than this
-overrides = {};
tried_too_hard_exc = "Tried too hard to find a free filename for %s; something's gone Pete Tong";
print "Checking for orphaned source packages..."
- # Get the list of source packages not in a suite and not linked to
- # by any binary packages.
+ # Get the list of source packages not in a suite.
q = projectB.query("""
SELECT s.id, s.file FROM source s
for i in q.getresult():
filename = i[0] + i[1];
if not os.path.exists(filename):
- sys.stderr.write("E: can not find %s.\n" % (filename));
+ utils.warn("can not find '%s'." % (filename));
continue;
if os.path.isfile(filename):
if os.path.islink(filename):
else:
utils.move(filename, dest_filename);
else:
- sys.stderr.write("%s is neither symlink nor file?!\n" % (filename));
- sys.exit(1);
+ utils.fubar("%s is neither symlink nor file?!" % (filename));
# Delete from the 'files' table
if not Cnf["Rhona::Options::No-Action"]:
print "rhona version 0.0000000000";
usage(0);
- override_filename = Cnf["Dir::OverrideDir"] + Cnf["Rhona::OverrideFilename"];
- if not os.access(override_filename, os.R_OK):
- sys.stderr.write("W: Could not find source-only override file '%s'.\n" % (override_filename));
-
now_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()));
delete_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()-int(Cnf["Rhona::StayOfExecution"])));