X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=charisma;h=6a23ab9cd7c181c5217341ad4118e32c450e025b;hb=89ada75793da6403e6ceb74a66a119621f19bba4;hp=362ed5e59549046522678f28dced4972b61bda4a;hpb=b5ee62da9921f9e14343e880c156ab1bf9896190;p=dak.git diff --git a/charisma b/charisma index 362ed5e5..6a23ab9c 100755 --- a/charisma +++ b/charisma @@ -2,7 +2,7 @@ # Generate Maintainers file used by e.g. the Debian Bug Tracking System # Copyright (C) 2000, 2001 James Troup -# $Id: charisma,v 1.7 2001-04-03 10:01:27 troup Exp $ +# $Id: charisma,v 1.9 2001-09-13 23:51:51 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 @@ -55,12 +55,12 @@ def get_maintainer (maintainer): def get_maintainer_from_source (source_id): global maintainer_from_source_cache - + if not maintainer_from_source_cache.has_key(source_id): q = projectB.query("SELECT m.name FROM maintainer m, source s WHERE s.id = %s and s.maintainer = m.id" % (source_id)); maintainer = q.getresult()[0][0] maintainer_from_source_cache[source_id] = fix_maintainer(maintainer) - + return maintainer_from_source_cache[source_id] #################################################################################################################################### @@ -69,13 +69,13 @@ def main(): global Cnf, projectB; apt_pkg.init(); - + Cnf = apt_pkg.newConfiguration(); apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file()); extra_files = apt_pkg.ParseCommandLine(Cnf,[],sys.argv); - projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]), None, None, Cnf["DB::ROUser"]); + projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); db_access.init(Cnf, projectB); for suite in Cnf.SubTree("Suite").List(): @@ -104,7 +104,7 @@ def main(): source_id = binary[1]; version = binary[3]; # Use the source maintainer first; falling back on the binary maintainer as a last resort only - if source_id != 0: + if source_id != 0 and source_id != None: maintainer = get_maintainer_from_source(source_id); else: maintainer = get_maintainer(binary[2]); @@ -125,7 +125,7 @@ def main(): if not packages.has_key(package): packages[package] = { "maintainer": maintainer, "priority": 0 } file.close() - + package_keys = packages.keys() package_keys.sort() for package in package_keys: