mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake: bitbake-layers: show-cross-depends: add option to ignore a layer
By default, show-cross-depends shows dependencies on OE-Core (i.e. "meta") which is not particularly useful. Add an option to allow you to hide those. For example, to hide all dependencies on OE-Core: bitbake-layers show-cross-depends -i meta Multiple layers can be specified by using commas as separators (no spaces). (Bitbake rev: 0e9062e65acbb05c1d9b3a9145eb866c3d562309) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
235f6c4497
commit
e124c0f9a8
+24
-20
@@ -566,26 +566,29 @@ Recipes are listed with the bbappends that apply to them as subitems.
|
|||||||
def do_show_cross_depends(self, args):
|
def do_show_cross_depends(self, args):
|
||||||
"""figure out the dependency between recipes that crosses a layer boundary.
|
"""figure out the dependency between recipes that crosses a layer boundary.
|
||||||
|
|
||||||
usage: show-cross-depends [-f]
|
usage: show-cross-depends [-f] [-i layer1[,layer2[,layer3...]]]
|
||||||
|
|
||||||
Figure out the dependency between recipes that crosses a layer boundary.
|
Figure out the dependency between recipes that crosses a layer boundary.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-f show full file path
|
-f show full file path
|
||||||
|
-i ignore dependencies on items in the specified layer(s)
|
||||||
|
|
||||||
NOTE:
|
NOTE:
|
||||||
The .bbappend file can impact the dependency.
|
The .bbappend file can impact the dependency.
|
||||||
"""
|
"""
|
||||||
self.init_bbhandler()
|
import optparse
|
||||||
|
|
||||||
show_filenames = False
|
parser = optparse.OptionParser(usage="show-cross-depends [-f] [-i layer1[,layer2[,layer3...]]]")
|
||||||
for arg in args.split():
|
parser.add_option("-f", "",
|
||||||
if arg == '-f':
|
action="store_true", dest="show_filenames")
|
||||||
show_filenames = True
|
parser.add_option("-i", "",
|
||||||
else:
|
action="store", dest="ignore_layers", default="")
|
||||||
sys.stderr.write("show-cross-depends: invalid option %s\n" % arg)
|
|
||||||
self.do_help('')
|
options, args = parser.parse_args(sys.argv)
|
||||||
return
|
ignore_layers = options.ignore_layers.split(',')
|
||||||
|
|
||||||
|
self.init_bbhandler()
|
||||||
|
|
||||||
pkg_fn = self.bbhandler.cooker_data.pkg_fn
|
pkg_fn = self.bbhandler.cooker_data.pkg_fn
|
||||||
bbpath = str(self.bbhandler.config_data.getVar('BBPATH', True))
|
bbpath = str(self.bbhandler.config_data.getVar('BBPATH', True))
|
||||||
@@ -607,7 +610,7 @@ The .bbappend file can impact the dependency.
|
|||||||
self.bbhandler.config_data,
|
self.bbhandler.config_data,
|
||||||
self.bbhandler.cooker_data,
|
self.bbhandler.cooker_data,
|
||||||
self.bbhandler.cooker_data.pkg_pn)
|
self.bbhandler.cooker_data.pkg_pn)
|
||||||
self.check_cross_depends("DEPENDS", layername, f, best[3], show_filenames)
|
self.check_cross_depends("DEPENDS", layername, f, best[3], options.show_filenames, ignore_layers)
|
||||||
|
|
||||||
# The RDPENDS
|
# The RDPENDS
|
||||||
all_rdeps = self.bbhandler.cooker_data.rundeps[f].values()
|
all_rdeps = self.bbhandler.cooker_data.rundeps[f].values()
|
||||||
@@ -624,7 +627,7 @@ The .bbappend file can impact the dependency.
|
|||||||
best = bb.providers.filterProvidersRunTime(all_p, rdep,
|
best = bb.providers.filterProvidersRunTime(all_p, rdep,
|
||||||
self.bbhandler.config_data,
|
self.bbhandler.config_data,
|
||||||
self.bbhandler.cooker_data)[0][0]
|
self.bbhandler.cooker_data)[0][0]
|
||||||
self.check_cross_depends("RDEPENDS", layername, f, best, show_filenames)
|
self.check_cross_depends("RDEPENDS", layername, f, best, options.show_filenames, ignore_layers)
|
||||||
|
|
||||||
# The inherit class
|
# The inherit class
|
||||||
cls_re = re.compile('classes/')
|
cls_re = re.compile('classes/')
|
||||||
@@ -635,8 +638,8 @@ The .bbappend file can impact the dependency.
|
|||||||
# ignore the classes/cls.
|
# ignore the classes/cls.
|
||||||
if not cls_re.match(cls):
|
if not cls_re.match(cls):
|
||||||
inherit_layername = self.get_file_layer(cls)
|
inherit_layername = self.get_file_layer(cls)
|
||||||
if inherit_layername != layername:
|
if inherit_layername != layername and not inherit_layername in ignore_layers:
|
||||||
if not show_filenames:
|
if not options.show_filenames:
|
||||||
f_short = self.remove_layer_prefix(f)
|
f_short = self.remove_layer_prefix(f)
|
||||||
cls = self.remove_layer_prefix(cls)
|
cls = self.remove_layer_prefix(cls)
|
||||||
else:
|
else:
|
||||||
@@ -656,7 +659,7 @@ The .bbappend file can impact the dependency.
|
|||||||
if pv_re.search(needed_file) and f in self.bbhandler.cooker_data.pkg_pepvpr:
|
if pv_re.search(needed_file) and f in self.bbhandler.cooker_data.pkg_pepvpr:
|
||||||
pv = self.bbhandler.cooker_data.pkg_pepvpr[f][1]
|
pv = self.bbhandler.cooker_data.pkg_pepvpr[f][1]
|
||||||
needed_file = re.sub(r"\${PV}", pv, needed_file)
|
needed_file = re.sub(r"\${PV}", pv, needed_file)
|
||||||
self.print_cross_files(bbpath, keyword, layername, f, needed_file, show_filenames)
|
self.print_cross_files(bbpath, keyword, layername, f, needed_file, options.show_filenames, ignore_layers)
|
||||||
line = fnfile.readline()
|
line = fnfile.readline()
|
||||||
fnfile.close()
|
fnfile.close()
|
||||||
|
|
||||||
@@ -683,21 +686,22 @@ The .bbappend file can impact the dependency.
|
|||||||
bbclass=".bbclass"
|
bbclass=".bbclass"
|
||||||
# Find a 'require/include xxxx'
|
# Find a 'require/include xxxx'
|
||||||
if m:
|
if m:
|
||||||
self.print_cross_files(bbpath, keyword, layername, f, m.group(1) + bbclass, show_filenames)
|
self.print_cross_files(bbpath, keyword, layername, f, m.group(1) + bbclass, options.show_filenames, ignore_layers)
|
||||||
line = ffile.readline()
|
line = ffile.readline()
|
||||||
ffile.close()
|
ffile.close()
|
||||||
|
|
||||||
def print_cross_files(self, bbpath, keyword, layername, f, needed_filename, show_filenames):
|
def print_cross_files(self, bbpath, keyword, layername, f, needed_filename, show_filenames, ignore_layers):
|
||||||
"""Print the depends that crosses a layer boundary"""
|
"""Print the depends that crosses a layer boundary"""
|
||||||
needed_file = bb.utils.which(bbpath, needed_filename)
|
needed_file = bb.utils.which(bbpath, needed_filename)
|
||||||
if needed_file:
|
if needed_file:
|
||||||
# Which layer is this file from
|
# Which layer is this file from
|
||||||
needed_layername = self.get_file_layer(needed_file)
|
needed_layername = self.get_file_layer(needed_file)
|
||||||
if needed_layername != layername:
|
if needed_layername != layername and not needed_layername in ignore_layers:
|
||||||
if not show_filenames:
|
if not show_filenames:
|
||||||
f = self.remove_layer_prefix(f)
|
f = self.remove_layer_prefix(f)
|
||||||
needed_file = self.remove_layer_prefix(needed_file)
|
needed_file = self.remove_layer_prefix(needed_file)
|
||||||
logger.plain("%s %s %s" %(f, keyword, needed_file))
|
logger.plain("%s %s %s" %(f, keyword, needed_file))
|
||||||
|
|
||||||
def match_inherit(self, line):
|
def match_inherit(self, line):
|
||||||
"""Match the inherit xxx line"""
|
"""Match the inherit xxx line"""
|
||||||
return (self.inherit_re.match(line), "inherits")
|
return (self.inherit_re.match(line), "inherits")
|
||||||
@@ -711,11 +715,11 @@ The .bbappend file can impact the dependency.
|
|||||||
keyword = "includes"
|
keyword = "includes"
|
||||||
return (m, keyword)
|
return (m, keyword)
|
||||||
|
|
||||||
def check_cross_depends(self, keyword, layername, f, needed_file, show_filenames):
|
def check_cross_depends(self, keyword, layername, f, needed_file, show_filenames, ignore_layers):
|
||||||
"""Print the DEPENDS/RDEPENDS file that crosses a layer boundary"""
|
"""Print the DEPENDS/RDEPENDS file that crosses a layer boundary"""
|
||||||
best_realfn = bb.cache.Cache.virtualfn2realfn(needed_file)[0]
|
best_realfn = bb.cache.Cache.virtualfn2realfn(needed_file)[0]
|
||||||
needed_layername = self.get_file_layer(best_realfn)
|
needed_layername = self.get_file_layer(best_realfn)
|
||||||
if needed_layername != layername:
|
if needed_layername != layername and not needed_layername in ignore_layers:
|
||||||
if not show_filenames:
|
if not show_filenames:
|
||||||
f = self.remove_layer_prefix(f)
|
f = self.remove_layer_prefix(f)
|
||||||
best_realfn = self.remove_layer_prefix(best_realfn)
|
best_realfn = self.remove_layer_prefix(best_realfn)
|
||||||
|
|||||||
Reference in New Issue
Block a user