From: James Troup Date: Sun, 17 Dec 2000 22:11:12 +0000 (+0000) Subject: fix charisma to do version compares and make source dominate binary. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=e6ea14ee5b7d8e66f3af75d70c7e6cf35f37ebcf;p=dak.git fix charisma to do version compares and make source dominate binary. --- diff --git a/THANKS b/THANKS index e8ef9ef5..6190ce98 100644 --- a/THANKS +++ b/THANKS @@ -11,4 +11,5 @@ Guy Maor Jason Gunthorpe Joey Hess Michael Beattie +Michael Mattice Robert Bihlmeyer diff --git a/TODO b/TODO index 9022c3c8..7e4b30d3 100644 --- a/TODO +++ b/TODO @@ -11,10 +11,9 @@ Non-Show Stopper o CD building scripts need fixing - o charisma needs to do version compares - o Optimize all the queries by using EXAMINE and building some INDEXs. o enclose all the setting SQL stuff in transactions (mostly done). + o clear out maintainers table == diff --git a/charisma b/charisma index 15798027..a9fc2005 100755 --- a/charisma +++ b/charisma @@ -2,7 +2,7 @@ # Generate Maintainers file used by e.g. the Debian Bug Tracking System # Copyright (C) 2000 James Troup -# $Id: charisma,v 1.1 2000-11-24 00:20:11 troup Exp $ +# $Id: charisma,v 1.2 2000-12-17 22:11:12 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 @@ -18,6 +18,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +#################################################################################################################################### + # ``As opposed to "Linux sucks. Respect my academic authoritah, damn # you!" or whatever all this hot air amounts to.'' # -- ajt@ in _that_ thread on debian-devel@ @@ -85,35 +87,40 @@ def main(): for suite in Cnf.SubTree("Suite").List(): suite = string.lower(suite); - suite_priority = int(Cnf["Suite::%s::Priority" % (suite)]) + suite_priority = int(Cnf["Suite::%s::Priority" % (suite)]); + + # Source packages + q = projectB.query("SELECT s.source, s.version, m.name FROM src_associations sa, source s, suite su, maintainer m WHERE su.suite_name = '%s' AND sa.suite = su.id AND sa.source = s.id AND m.id = s.maintainer" % (suite)) + sources = q.getresult(); + for source in sources: + package = source[0]; + version = source[1]; + maintainer = fix_maintainer(source[2]); + if packages.has_key(package): + 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: + packages[package] = { "maintainer": maintainer, "priority": suite_priority, "version": version }; + # Binary packages - q = projectB.query("SELECT b.package, b.source, b.maintainer FROM bin_associations ba, binaries b, suite s WHERE s.suite_name = '%s' AND ba.suite = s.id AND ba.bin = b.id" % (suite)); + q = projectB.query("SELECT b.package, b.source, b.maintainer, b.version FROM bin_associations ba, binaries b, suite s WHERE s.suite_name = '%s' AND ba.suite = s.id AND ba.bin = b.id" % (suite)); binaries = q.getresult(); for binary in binaries: - package = binary[0] - source_id = binary[1] + package = binary[0]; + 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: - maintainer = get_maintainer_from_source(source_id) - else: - maintainer = get_maintainer(binary[2]) - if packages.has_key(package): - if packages[package]["priority"] < suite_priority: - packages[package] = { "maintainer": maintainer, "priority": suite_priority } + maintainer = get_maintainer_from_source(source_id); else: - packages[package] = { "maintainer": maintainer, "priority": suite_priority } - - # Source packages - q = projectB.query("SELECT s.source, m.name FROM src_associations sa, source s, suite su, maintainer m WHERE su.suite_name = '%s' AND sa.suite = su.id AND sa.source = s.id AND m.id = s.maintainer" % (suite)) - sources = q.getresult(); - for source in sources: - package = source[0] - maintainer = fix_maintainer(source[1]) + maintainer = get_maintainer(binary[2]); if packages.has_key(package): if packages[package]["priority"] < suite_priority: - packages[package] = { "maintainer": maintainer, "priority": suite_priority } + if apt_pkg.VersionCompare(packages[package]["version"], version) == -1: + packages[package] = { "maintainer": maintainer, "priority": suite_priority, "version": version }; else: - packages[package] = { "maintainer": maintainer, "priority": suite_priority } + packages[package] = { "maintainer": maintainer, "priority": suite_priority, "version": version }; # Process any additional Maintainer files (e.g. from non-US or pseudo packages) for filename in extra_files: