# Generate Maintainers file used by e.g. the Debian Bug Tracking System
# Copyright (C) 2000 James Troup <james@nocrew.org>
-# $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
# 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@
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: