- if (comma_count >= 2):
- result += ", ";
- or_count = 1
- for d in l:
- if (or_count >= 2 ):
- result += " | "
- # doesn't do version lookup yet.
-
- q = projectB.query("SELECT DISTINCT(b.package), b.version, c.name, su.suite_name FROM binaries b, files fi, location l, component c, bin_associations ba, suite su WHERE b.package='%s' AND b.file = fi.id AND fi.location = l.id AND l.component = c.id AND ba.bin=b.id AND ba.suite = su.id AND su.suite_name='%s' ORDER BY b.version desc" % (d['name'], suite));
- ql = q.getresult();
- if ql:
- i = ql[0];
-
- if i[2] == "contrib":
- result += contrib_colour + d['name'];
- elif i[2] == "non-free":
- result += nonfree_colour + d['name'];
- else :
- result += main_colour + d['name'];
-
- if d['version'] != '' :
- result += " (%s)" % (d['version']);
- result += end_colour;
- else:
- result += bold_colour + d['name'];
- if d['version'] != '' :
- result += " (%s)" % (d['version']);
- result += end_colour;
- or_count += 1;
- comma_count += 1;
- return result;
-
-def output_deb_info(filename):
- (control, control_keys, section, depends, recommends, arch, maintainer) = read_control(filename);
+ if (comma_count >= 2):
+ result += ", "
+ or_count = 1
+ for d in l:
+ if (or_count >= 2 ):
+ result += " | "
+ # doesn't do version lookup yet.
+
+ q = projectB.query("SELECT DISTINCT(b.package), b.version, c.name, su.suite_name FROM binaries b, files fi, location l, component c, bin_associations ba, suite su WHERE b.package='%s' AND b.file = fi.id AND fi.location = l.id AND l.component = c.id AND ba.bin=b.id AND ba.suite = su.id AND su.suite_name %s ORDER BY b.version desc" % (d['name'], suite_where))
+ ql = q.getresult()
+ if ql:
+ i = ql[0]
+
+ adepends = d['name']
+ if d['version'] != '' :
+ adepends += " (%s)" % (d['version'])
+
+ if i[2] == "contrib":
+ result += colour_output(adepends, "contrib")
+ elif i[2] == "non-free":
+ result += colour_output(adepends, "nonfree")
+ else :
+ result += colour_output(adepends, "main")
+ else:
+ adepends = d['name']
+ if d['version'] != '' :
+ adepends += " (%s)" % (d['version'])
+ result += colour_output(adepends, "bold")
+ or_count += 1
+ comma_count += 1
+ return result
+
+def output_package_relations ():
+ """
+ Output the package relations, if there is more than one package checked in this run.
+ """
+
+ if len(package_relations) < 2:
+ # Only list something if we have more than one binary to compare
+ return
+
+ to_print = ""
+ for package in package_relations:
+ for relation in package_relations[package]:
+ to_print += "%-15s: (%s) %s\n" % (package, relation, package_relations[package][relation])
+
+ package_relations.clear()
+ foldable_output("Package relations", "relations", to_print)
+
+def output_deb_info(suite, filename, packagename):
+ (control, control_keys, section, depends, recommends, arch, maintainer) = read_control(filename)