* [PATCHv2 1/2] scripts/lib/compatlayer: detect_layers always use realpath's
@ 2017-03-30 20:01 Aníbal Limón
2017-03-30 20:01 ` [PATCHv2 2/2] scripts: Add yocto-compat-layer-wrapper Aníbal Limón
0 siblings, 1 reply; 2+ messages in thread
From: Aníbal Limón @ 2017-03-30 20:01 UTC (permalink / raw)
To: openembedded-core; +Cc: saul.wold
If you are using relative paths and change to other folder for
execution it will fail, so use realpaths always.
[YOCTO #11164]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
scripts/lib/compatlayer/__init__.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/lib/compatlayer/__init__.py b/scripts/lib/compatlayer/__init__.py
index 58f94b7..087ac14 100644
--- a/scripts/lib/compatlayer/__init__.py
+++ b/scripts/lib/compatlayer/__init__.py
@@ -112,6 +112,7 @@ def detect_layers(layer_directories, no_auto):
layers = []
for directory in layer_directories:
+ directory = os.path.realpath(directory)
if directory[-1] == '/':
directory = directory[0:-1]
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCHv2 2/2] scripts: Add yocto-compat-layer-wrapper
2017-03-30 20:01 [PATCHv2 1/2] scripts/lib/compatlayer: detect_layers always use realpath's Aníbal Limón
@ 2017-03-30 20:01 ` Aníbal Limón
0 siblings, 0 replies; 2+ messages in thread
From: Aníbal Limón @ 2017-03-30 20:01 UTC (permalink / raw)
To: openembedded-core; +Cc: saul.wold
This script will be used to create it's own build directory to make
runs of yocto-compat-layer.py againts layers isolated.
Example:
$ source oe-init-build-env
$ yocto-compat-layer-wrapper LAYER_DIR LAYER_DIR_N
[YOCTO #11164]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
scripts/yocto-compat-layer-wrapper | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100755 scripts/yocto-compat-layer-wrapper
diff --git a/scripts/yocto-compat-layer-wrapper b/scripts/yocto-compat-layer-wrapper
new file mode 100755
index 0000000..db4b687
--- /dev/null
+++ b/scripts/yocto-compat-layer-wrapper
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# Yocto Project compatibility layer tool wrapper
+#
+# Creates a temprary build directory to run Yocto Project Compatible
+# script to avoid a contaminated environment.
+#
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+if [ -z "$BUILDDIR" ]; then
+ echo "Please source oe-init-build-env before run this script."
+ exit 2
+fi
+
+base_dir=$(realpath $BUILDDIR/../)
+cd $base_dir
+
+build_dir=$(mktemp -p $base_dir -d -t build-XXXX)
+
+source oe-init-build-env $build_dir
+yocto-compat-layer.py "$@"
+retcode=$?
+
+rm -rf $build_dir
+
+exit $retcode
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-30 19:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-30 20:01 [PATCHv2 1/2] scripts/lib/compatlayer: detect_layers always use realpath's Aníbal Limón
2017-03-30 20:01 ` [PATCHv2 2/2] scripts: Add yocto-compat-layer-wrapper Aníbal Limón
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox