+ # Get a list of binaries and source with their latest suite
+ binaries = get_binaries();
+ source = get_source();
+
+ as_binaries = {};
+ as_source = {};
+
+ filename = "/org/buildd.debian.org/web/quinn-diff/Packages-arch-specific";
+ file = utils.open_file(filename, 'r');
+ line_count = 0;
+ for line in file.readlines():
+ line = string.strip(utils.re_comments.sub("", line));
+ line_count = line_count + 1;
+ if line == "":
+ continue;
+ sline = string.split(line, ':');
+ if len(sline) != 2:
+ utils.warn("parse error on line %s; skipping" % (line_count));
+ continue;
+ (package, architectures) = map(string.strip, sline);
+ # Binary
+ if package[0] != '%':
+ if not binaries.has_key(package):
+ if source.has_key(package):
+ print "SHOULD BE SOURCE: %s ==> %s" % (package, architectures);
+ else:
+ print "MISSING: %s ==> %s" % (package, architectures);
+ else:
+ if binaries[package] == "unstable":
+ as_binaries[package] = architectures;
+
+ # Source
+ else:
+ package = package[1:]
+ if not source.has_key(package):
+ if binaries.has_key(package):
+ print "SHOULD BE BINARY: %s ==> %s" % (package, architectures);
+ else:
+ print "[source] MISSING: %s ==> %s" % (package, architectures);
+ else:
+ if source[package] == "unstable":
+ as_source[package] = architectures;
+
+ suite_id = db_access.get_suite_id("unstable");
+ for package in as_binaries.keys():
+ as_architectures = string.split(as_binaries[package]);
+ arches_arch_specific = {};
+ for i in as_architectures:
+ arches_arch_specific[i] = "";
+
+ q = projectB.query("SELECT a.arch_string FROM bin_associations ba, binaries b, architecture a WHERE a.id = b.architecture AND b.package = '%s' AND ba.suite = %s AND ba.bin = b.id" % (package, suite_id));
+ ql = q.getresult();
+
+ print "%s: %s vs. %s" % (package, ql, as_architectures);
+
+ arches_in_archive = {};
+ for i in ql:
+ arches_in_archive[i[0]] = "";
+
+ for arch in as_architectures:
+ if arch[0] == "!":
+ arch = arch[1:];
+ if arches_in_archive.has_key(arch):
+ utils.warn("%s is excluded from %s but is in the archive for %s.[1]" % (package, arch, arch));
+ else:
+ if not arches_in_archive.has_key(arch):
+ utils.warn("%s is listed as buildable on %s but isn't in the archive for %s." % (package, arch, arch));
+
+ for arch in arches_in_archive.keys():
+ if not arches_arch_specific.has_key(arch):
+ utils.warn("%s is excluded from %s but is in the archive for %s.[2]" % (package, arch, arch));
+
+# HO HUM; maybe have control words in the comments like "<STABLE>" ? bit icky
+# see if package exists at all
+# see if package exists for excluded arch
+# see if package in specific suite
+# compare against source package's .dsc!
+# ??
+