aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/compatlayer/__init__.py
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-03-20 17:33:25 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-21 22:43:04 +0000
commitf2f6f0c938226802163698ef14a8a9103da362a0 (patch)
tree7699838e01424d94faa81018608e6e2d6e12f00e /scripts/lib/compatlayer/__init__.py
parent576c6486f547b1d7422cdd12f688aef74ee632ae (diff)
downloadopenembedded-core-contrib-f2f6f0c938226802163698ef14a8a9103da362a0.tar.gz
scripts/yocto-compat-layer.py: Add option to disable layer autodiscovery
Sometimes there is a need to only analyze the layer specified by the command line, the new option -n will disable autodiscovery of layers and only will try to test specified layers. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/lib/compatlayer/__init__.py')
-rw-r--r--scripts/lib/compatlayer/__init__.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/lib/compatlayer/__init__.py b/scripts/lib/compatlayer/__init__.py
index 15dc95da1f..b8ce771319 100644
--- a/scripts/lib/compatlayer/__init__.py
+++ b/scripts/lib/compatlayer/__init__.py
@@ -108,20 +108,27 @@ def _detect_layer(layer_path):
return layer
-def detect_layers(layer_directories):
+def detect_layers(layer_directories, no_auto):
layers = []
for directory in layer_directories:
if directory[-1] == '/':
directory = directory[0:-1]
- for root, dirs, files in os.walk(directory):
- dir_name = os.path.basename(root)
- conf_dir = os.path.join(root, 'conf')
+ if no_auto:
+ conf_dir = os.path.join(directory, 'conf')
if os.path.isdir(conf_dir):
- layer = _detect_layer(root)
+ layer = _detect_layer(directory)
if layer:
layers.append(layer)
+ else:
+ for root, dirs, files in os.walk(directory):
+ dir_name = os.path.basename(root)
+ conf_dir = os.path.join(root, 'conf')
+ if os.path.isdir(conf_dir):
+ layer = _detect_layer(root)
+ if layer:
+ layers.append(layer)
return layers