From 1d9559a7fb9fe48c52e99d5a8b9e84a6f3517ae2 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sat, 4 Apr 2009 15:24:22 +0200 Subject: [PATCH] examine_package output a list of package relations at the very end of our run. should make it easier to compare them for packages that split into MANY Signed-off-by: Joerg Jaspert --- dak/examine_package.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dak/examine_package.py b/dak/examine_package.py index 5c80cf05..abddf5a4 100755 --- a/dak/examine_package.py +++ b/dak/examine_package.py @@ -61,6 +61,7 @@ projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])) database.init(Cnf, projectB) printed_copyrights = {} +package_relations = {} # default is to not output html. use_html = 0 @@ -344,17 +345,37 @@ def create_depends_string (suite, depends_tree): 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]) + + 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) if control == '': return formatted_text("no control info") to_print = "" + if not package_relations.has_key(packagename): + package_relations[packagename] = {} for key in control_keys : if key == 'Depends': field_value = create_depends_string(suite, depends) + package_relations[packagename][key] = field_value elif key == 'Recommends': field_value = create_depends_string(suite, recommends) + package_relations[packagename][key] = field_value elif key == 'Section': field_value = section elif key == 'Architecture': @@ -534,6 +555,7 @@ def main (): else: utils.fubar("Unrecognised file type: '%s'." % (f)) finally: + output_package_relations() if not Options["Html-Output"]: # Reset stdout here so future less invocations aren't FUBAR less_fd.close() -- 2.39.5