From 4bee0378070456c9460b47e06a1cd9a9df5c5a47 Mon Sep 17 00:00:00 2001 From: josch Date: Tue, 9 Oct 2012 09:19:01 +0200 Subject: [PATCH] add comments --- find_reduced.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/find_reduced.py b/find_reduced.py index e257d35..5904205 100755 --- a/find_reduced.py +++ b/find_reduced.py @@ -43,6 +43,7 @@ def flatten(l): l[0:1] = l[0] if l: yield l.pop(0) +# read mapping between Gentoo and Debian packages deb2gen = dict() gen2deb = dict() with open("./deb2gen_mapping.list") as f: @@ -104,7 +105,8 @@ before = datetime.now() debian_deps = dict() missing_gen_mappings = list() -# look for reduced build dependencies +# look for reduced build dependencies of gentoo packages by extracting all +# dependencies that need a USE flag to be set for i, (cat, pkg, ver, rev) in enumerate(pkgnames): if rev == "r0": pkgname = "%s/%s-%s"%(cat, pkg, ver) @@ -119,7 +121,7 @@ for i, (cat, pkg, ver, rev) in enumerate(pkgnames): no_use = use_reduce(depend, matchnone=True) l = list() for a in all_use: - # filter out all dependencies that are also present without USE flags enabled + # filter out all dependencies that are also present when USE flags are disabled if a in no_use: continue @@ -163,6 +165,8 @@ missing_deb_mappings = list() src2bin = dict() src_deps = dict() +# get the actual Debian build dependencies for all interesting packages from a +# Sources file for pkg in apt_pkg.TagFile(sys.argv[1]): p = pkg['Package'] try: @@ -172,7 +176,11 @@ for pkg in apt_pkg.TagFile(sys.argv[1]): src_deps[p] = [] src2bin[p] = [b.strip() for b in pkg['Binary'].split(',')] -# process all debian source packages +all_droppable = list() + +# process all debian source packages and output those build dependencies that +# build from a source package which is not needed by the corresponding Gentoo +# package for d in debian_names: # find gentoo package name g = deb2gen.get(d)