- results = results + 1;
- package = i[0];
- version = i[1];
- architecture = i[2];
- suite = i[3];
- if not d.has_key(version):
- d[version] = {};
- if not d[version].has_key(suite):
- d[version][suite] = [];
- d[version][suite].append(architecture);
-
- versions = d.keys();
- versions.sort(apt_pkg.VersionCompare);
- for version in versions:
- suites = d[version].keys();
- suites.sort();
- for suite in suites:
- sys.stdout.write("%10s | %10s | %13s | " % (package, version, suite));
- count = 0;
- arches = d[version][suite];
- arches.sort(arch_compare);
- for arch in arches:
- if count > 0:
- sys.stdout.write(', ');
- sys.stdout.write(arch);
- count = count + 1;
- sys.stdout.write('\n');
+ results += 1;
+ (pkg, version, architecture, suite, component, maintainer) = i;
+ if component != "main":
+ suite = "%s/%s" % (suite, component);
+ if not d.has_key(pkg):
+ d[pkg] = {};
+ highver.setdefault(pkg,"");
+ if not d[pkg].has_key(version):
+ d[pkg][version] = {};
+ if apt_pkg.VersionCompare(version, highver[pkg]) > 0:
+ highver[pkg] = version;
+ if not d[pkg][version].has_key(suite):
+ d[pkg][version][suite] = [];
+ d[pkg][version][suite].append(architecture);
+
+ packages = d.keys();
+ packages.sort();
+ for pkg in packages:
+ versions = d[pkg].keys();
+ versions.sort(apt_pkg.VersionCompare);
+ for version in versions:
+ suites = d[pkg][version].keys();
+ suites.sort();
+ for suite in suites:
+ arches = d[pkg][version][suite];
+ arches.sort(utils.arch_compare_sw);
+ if Options["Format"] == "": #normal
+ sys.stdout.write("%10s | %10s | %13s | " % (pkg, version, suite));
+ sys.stdout.write(", ".join(arches));
+ sys.stdout.write('\n');
+ elif Options["Format"] == "heidi":
+ for arch in arches:
+ sys.stdout.write("%s %s %s\n" % (pkg, version, arch));
+ if Options["GreaterOrEqual"]:
+ print "\n%s (>= %s)" % (pkg, highver[pkg])
+ if Options["GreaterThan"]:
+ print "\n%s (>> %s)" % (pkg, highver[pkg])