#!/usr/bin/env python
# Check for obsolete binary packages
-# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup <james@nocrew.org>
-# $Id: rene,v 1.23 2005-04-16 09:19:20 rmurray Exp $
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 James Troup <james@nocrew.org>
# 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 commands, pg, os, string, sys, time
-import utils, db_access
import apt_pkg
+import dak.lib.database as database
+import dak.lib.utils as utils
################################################################################
################################################################################
def usage(exit_code=0):
- print """Usage: rene
+ print """Usage: dak cruft-report
Check for obsolete or duplicated packages.
-h, --help show this help and exit.
################################################################################
def do_nviu():
- experimental_id = db_access.get_suite_id("experimental")
+ experimental_id = database.get_suite_id("experimental")
if experimental_id == -1:
return
# Check for packages in experimental obsoleted by versions in unstable
WHERE sa.suite = %s AND sa2.suite = %d AND sa.source = s.id
AND sa2.source = s2.id AND s.source = s2.source
AND versioncmp(s.version, s2.version) < 0""" % (experimental_id,
- db_access.get_suite_id("unstable")))
+ database.get_suite_id("unstable")))
ql = q.getresult()
if ql:
nviu_to_remove = []
nviu_to_remove.append(source)
print
print "Suggested command:"
- print " melanie -m \"[rene] NVIU\" -s experimental %s" % (" ".join(nviu_to_remove))
+ print " dak rm -m \"[auto-cruft] NVIU\" -s experimental %s" % (" ".join(nviu_to_remove))
print
################################################################################
print output
print "Suggested command:"
- print " melanie -m \"[rene] NBS\" -b %s" % (" ".join(nbs_to_remove))
+ print " dak rm -m \"[auto-cruft] NBS\" -b %s" % (" ".join(nbs_to_remove))
print
################################################################################
print output
print "Suggested command:"
- print " melanie -S -p -m \"[rene] obsolete source package\" %s" % (" ".join(to_remove))
+ print " dak rm -S -p -m \"[auto-cruft] obsolete source package\" %s" % (" ".join(to_remove))
print
################################################################################
Cnf = utils.get_conf()
- Arguments = [('h',"help","Rene::Options::Help"),
- ('m',"mode","Rene::Options::Mode", "HasArg"),
- ('s',"suite","Rene::Options::Suite","HasArg")]
+ Arguments = [('h',"help","Cruft-Report::Options::Help"),
+ ('m',"mode","Cruft-Report::Options::Mode", "HasArg"),
+ ('s',"suite","Cruft-Report::Options::Suite","HasArg")]
for i in [ "help" ]:
- if not Cnf.has_key("Rene::Options::%s" % (i)):
- Cnf["Rene::Options::%s" % (i)] = ""
- Cnf["Rene::Options::Suite"] = Cnf["Dinstall::DefaultSuite"]
+ if not Cnf.has_key("Cruft-Report::Options::%s" % (i)):
+ Cnf["Cruft-Report::Options::%s" % (i)] = ""
+ Cnf["Cruft-Report::Options::Suite"] = Cnf["Dinstall::DefaultSuite"]
- if not Cnf.has_key("Rene::Options::Mode"):
- Cnf["Rene::Options::Mode"] = "daily"
+ if not Cnf.has_key("Cruft-Report::Options::Mode"):
+ Cnf["Cruft-Report::Options::Mode"] = "daily"
apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
- Options = Cnf.SubTree("Rene::Options")
+ Options = Cnf.SubTree("Cruft-Report::Options")
if Options["Help"]:
usage()
usage(1)
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
- db_access.init(Cnf, projectB)
+ database.init(Cnf, projectB)
bin_pkgs = {}
src_pkgs = {}
duplicate_bins = {}
suite = Options["Suite"]
- suite_id = db_access.get_suite_id(suite)
+ suite_id = database.get_suite_id(suite)
bin_not_built = {}