scripts: Add yocto-compat-layer-wrapper

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]

(From OE-Core rev: 9414382f96d4a5d81cca440c75140950ca515aab)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Aníbal Limón 2017-03-30 14:01:14 -06:00 committed by Richard Purdie
parent 4bd647af83
commit 704613b2ec
1 changed files with 27 additions and 0 deletions

View File

@ -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