#!/usr/bin/env python import sys from os import path pym_path = path.join(path.dirname(path.realpath(__file__)), "portage", "pym") sys.path.insert(0, pym_path) from portage.versions import pkgsplit deb2gen = dict() gen2deb = dict() with open("./deb2gen_mapping.list") as f: for line in f: d, g = line.strip().split('\t') deb2gen[d] = g gen2deb[g] = d with open("./deb_source_pkgs.list") as f: debian_names = [p[4:].strip() for p in f] gentoo_deps = dict() with open("./reduced_gen_deps.list") as f: for line in f: p = line.strip().split() gentoo_deps[pkgsplit(p[0])[0]] = p[1:] missing_deb_mappings = list() missing_gen_mappings = list() for d in debian_names: g = deb2gen.get(d) if g: deps = gentoo_deps.get(g) if deps: ddeps = [] for p in deps: r = gen2deb.get(p) if r: ddeps.append(r) else: missing_gen_mappings.append(p) ddeps = list(set(ddeps)) if ddeps: print d, ddeps else: missing_deb_mappings.append(d) print list(set(missing_deb_mappings)) print list(set(missing_gen_mappings))