+
+################################################################################
+
+# Check for out-of-date binaries on architectures that do not want to build that
+# package any more, and have them listed as Not-For-Us
+def do_nfu(nfu_packages):
+ output = ""
+
+ a2p = {}
+
+ for architecture in nfu_packages:
+ a2p[architecture] = []
+ for (package,bver,sver) in nfu_packages[architecture]:
+ output += " * [%s] does not want %s (binary %s, source %s)\n" % (architecture, package, bver, sver)
+ a2p[architecture].append(package)
+
+
+ if output:
+ print "Obsolete by Not-For-Us"
+ print "----------------------"
+ print
+ print output
+
+ print "Suggested commands:"
+ for architecture in a2p:
+ if a2p[architecture]:
+ print (" dak rm -m \"[auto-cruft] NFU\" -s %s -a %s -b %s" %
+ (suite, architecture, " ".join(a2p[architecture])))
+ print
+
+def parse_nfu(architecture):
+ # utils/hpodder_1.1.5.0: Not-For-Us [optional:out-of-date]
+ r = re.compile("^\w+/([^_]+)_.*: Not-For-Us")
+
+ ret = set()
+
+ filename = "%s/%s-all.txt" % (Cnf["Cruft-Report::Options::Wanna-Build-Dump"], architecture)
+
+ # Not all architectures may have a wanna-build dump, so we want to ignore missin
+ # files
+ if os.path.exists(filename):
+ f = utils.open_file(filename)
+ for line in f:
+ if line[0] == ' ':
+ continue
+
+ m = r.match(line)
+ if m:
+ ret.add(m.group(1))
+
+ f.close()
+ else:
+ utils.warn("No wanna-build dump file for architecture %s" % architecture)
+ return ret
+