diff options
Diffstat (limited to 'scripts/lib/devtool/standard.py')
| -rw-r--r-- | scripts/lib/devtool/standard.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index aca74b1fc6..47ed531b03 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
| @@ -1866,13 +1866,27 @@ def reset(args, config, basepath, workspace): | |||
| 1866 | def _get_layer(layername, d): | 1866 | def _get_layer(layername, d): |
| 1867 | """Determine the base layer path for the specified layer name/path""" | 1867 | """Determine the base layer path for the specified layer name/path""" |
| 1868 | layerdirs = d.getVar('BBLAYERS').split() | 1868 | layerdirs = d.getVar('BBLAYERS').split() |
| 1869 | layers = {os.path.basename(p): p for p in layerdirs} | 1869 | layers = {} # {basename: layer_paths} |
| 1870 | for p in layerdirs: | ||
| 1871 | bn = os.path.basename(p) | ||
| 1872 | if bn not in layers: | ||
| 1873 | layers[bn] = [p] | ||
| 1874 | else: | ||
| 1875 | layers[bn].append(p) | ||
| 1870 | # Provide some shortcuts | 1876 | # Provide some shortcuts |
| 1871 | if layername.lower() in ['oe-core', 'openembedded-core']: | 1877 | if layername.lower() in ['oe-core', 'openembedded-core']: |
| 1872 | layerdir = layers.get('meta', None) | 1878 | layername = 'meta' |
| 1879 | layer_paths = layers.get(layername, None) | ||
| 1880 | if not layer_paths: | ||
| 1881 | return os.path.abspath(layername) | ||
| 1882 | elif len(layer_paths) == 1: | ||
| 1883 | return os.path.abspath(layer_paths[0]) | ||
| 1873 | else: | 1884 | else: |
| 1874 | layerdir = layers.get(layername, None) | 1885 | # multiple layers having the same base name |
| 1875 | return os.path.abspath(layerdir or layername) | 1886 | logger.warning("Multiple layers have the same base name '%s', use the first one '%s'." % (layername, layer_paths[0])) |
| 1887 | logger.warning("Consider using path instead of base name to specify layer:\n\t\t%s" % '\n\t\t'.join(layer_paths)) | ||
| 1888 | return os.path.abspath(layer_paths[0]) | ||
| 1889 | |||
| 1876 | 1890 | ||
| 1877 | def finish(args, config, basepath, workspace): | 1891 | def finish(args, config, basepath, workspace): |
| 1878 | """Entry point for the devtool 'finish' subcommand""" | 1892 | """Entry point for the devtool 'finish' subcommand""" |
