commit b219bcf93fd03c21e1bf6b548c6498fd0d67b215 Author: Bernhard Reutner-Fischer Date: Thu Oct 28 20:34:54 2010 +0200 native{,sdk}.bbclass: log redundant depends Signed-off-by: Bernhard Reutner-Fischer diff --git a/classes/native.bbclass b/classes/native.bbclass index 6f3a48d..80d0e9b 100644 --- a/classes/native.bbclass +++ b/classes/native.bbclass @@ -113,6 +113,7 @@ python __anonymous () { depends = bb.data.getVar("DEPENDS_virtclass-native", d, True) deps = bb.utils.explode_deps(depends) newdeps = [] + redundantdeps = [] for dep in deps: if dep.endswith("-cross"): newdeps.append(dep.replace("-cross", "-native")) @@ -120,6 +121,23 @@ python __anonymous () { newdeps.append(dep + "-native") else: newdeps.append(dep) + redundantdeps.append(dep) + implied = bb.utils.explode_deps(base_deps(d, 'native')) + if bb.data.inherits_class('autotools', d): + implied.extend(bb.utils.explode_deps(autotools_deps(d, 'native'))) + redundantdeps = filter(lambda x:x not in implied, redundantdeps) + if redundantdeps: + recipe = bb.data.getVar("FILE", d, True) + redundant = ", ".join(redundantdeps) + bb.note("Redundant depends for %s: %s" % (recipe, redundant)) + try: + f = open(os.path.join(bb.data.getVar("TMPDIR", d, 1), + 'redundant-depends-native.log'), "a") + f.write("%s: %s\n" % (recipe, redundant)) + f.close() + except: + pass + bb.data.setVar("DEPENDS_virtclass-native", " ".join(newdeps), d) provides = bb.data.getVar("PROVIDES", d, True) for prov in provides.split(): diff --git a/classes/nativesdk.bbclass b/classes/nativesdk.bbclass index 6f21534..e2c4eff 100644 --- a/classes/nativesdk.bbclass +++ b/classes/nativesdk.bbclass @@ -59,6 +59,7 @@ python __anonymous () { depends = bb.data.getVar("DEPENDS_virtclass-nativesdk", d, True) deps = bb.utils.explode_deps(depends) newdeps = [] + redundantdeps = [] for dep in deps: if dep.endswith("-native") or dep.endswith("-cross"): newdeps.append(dep) @@ -68,6 +69,22 @@ python __anonymous () { newdeps.append(dep + "-nativesdk") else: newdeps.append(dep) + redundantdeps.append(dep) + implied = bb.utils.explode_deps(base_deps(d, 'nativesdk')) + if bb.data.inherits_class('autotools', d): + implied.extend(bb.utils.explode_deps(autotools_deps(d, 'nativesdk'))) + redundantdeps = filter(lambda x:x not in implied, redundantdeps) + if redundantdeps: + recipe = bb.data.getVar("FILE", d, True) + redundant = ", ".join(redundantdeps) + bb.note("Redundant depends for %s: %s" % (recipe, redundant)) + try: + f = open(os.path.join(bb.data.getVar("TMPDIR", d, 1), + 'redundant-depends-nativesdk.log'), "a") + f.write("%s: %s\n" % (recipe, redundant)) + f.close() + except: + pass bb.data.setVar("DEPENDS_virtclass-nativesdk", " ".join(newdeps), d) provides = bb.data.getVar("PROVIDES", d, True) for prov in provides.split():