X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=charisma;h=aeebd81dda4ea8ccf1ca54acf8498362e3521d76;hb=ccc8127b612d886ccfdc26366313f985393c18af;hp=a9fc2005c96631cd1dcca229046abe19b3010601;hpb=e6ea14ee5b7d8e66f3af75d70c7e6cf35f37ebcf;p=dak.git diff --git a/charisma b/charisma index a9fc2005..aeebd81d 100755 --- a/charisma +++ b/charisma @@ -1,8 +1,8 @@ #!/usr/bin/env python # Generate Maintainers file used by e.g. the Debian Bug Tracking System -# Copyright (C) 2000 James Troup -# $Id: charisma,v 1.2 2000-12-17 22:11:12 troup Exp $ +# Copyright (C) 2000, 2001 James Troup +# $Id: charisma,v 1.6 2001-03-20 00:28:11 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,7 +55,7 @@ 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 name FROM maintainer WHERE id IN (SELECT maintainer FROM source WHERE id = %s)" % (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) @@ -76,8 +76,6 @@ def get_maintainer (maintainer_id): def main(): global Cnf, projectB; - projectB = pg.connect('projectb', 'localhost'); - apt_pkg.init(); Cnf = apt_pkg.newConfiguration(); @@ -85,6 +83,8 @@ def main(): 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"]); + for suite in Cnf.SubTree("Suite").List(): suite = string.lower(suite); suite_priority = int(Cnf["Suite::%s::Priority" % (suite)]); @@ -97,7 +97,7 @@ def main(): version = source[1]; maintainer = fix_maintainer(source[2]); if packages.has_key(package): - if packages[package]["priority"] < suite_priority: + if packages[package]["priority"] <= suite_priority: if apt_pkg.VersionCompare(packages[package]["version"], version) == -1: packages[package] = { "maintainer": maintainer, "priority": suite_priority, "version": version }; else: @@ -116,7 +116,7 @@ def main(): else: maintainer = get_maintainer(binary[2]); if packages.has_key(package): - if packages[package]["priority"] < suite_priority: + if packages[package]["priority"] <= suite_priority: if apt_pkg.VersionCompare(packages[package]["version"], version) == -1: packages[package] = { "maintainer": maintainer, "priority": suite_priority, "version": version }; else: