X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=rhona;h=9af184980d5939313d0605dec4cc30b6386fd15a;hb=4de0b2e26a27cc48fa2ac8f4bc28119b253ba34c;hp=3f3be031d3926f9dc7c15bfd343ef279dcfbd457;hpb=5144a464766f5c2ed592b5fa81e2943992f0c1fe;p=dak.git diff --git a/rhona b/rhona index 3f3be031..9af18498 100755 --- a/rhona +++ b/rhona @@ -1,8 +1,8 @@ #!/usr/bin/env python # rhona, cleans up unassociated binary and source packages -# Copyright (C) 2000 James Troup -# $Id: rhona,v 1.6 2000-12-20 08:15:35 troup Exp $ +# Copyright (C) 2000, 2001 James Troup +# $Id: rhona,v 1.8 2001-03-02 02:24:33 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 @@ -59,12 +59,16 @@ def in_override_p (package): if overrides == {}: filename = Cnf["Dir::OverrideDir"] + Cnf["Rhona::OverrideFilename"]; - file = utils.open_file(filename, 'r'); - for line in file.readlines(): - line = string.strip(utils.re_comments.sub('', line)) - if line != "": - overrides[line] = 1 - file.close() + try: + file = utils.open_file(filename, 'r'); + except utils.cant_open_exc: + pass; + else: + for line in file.readlines(): + line = string.strip(utils.re_comments.sub('', line)) + if line != "": + overrides[line] = 1 + file.close() return overrides.get(package, None); @@ -358,6 +362,10 @@ def main(): 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)); + delete_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time())); check_binaries();