mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

We are using a temp directory, use the realpath for output log to store the results in the original BUILDDIR. [YOCTO #11571] (From OE-Core rev: 0addd079966ece97abc2e0ba3e7d6434d23692aa) 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>
44 lines
940 B
Bash
Executable File
44 lines
940 B
Bash
Executable File
#!/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
|
|
|
|
# since we are using a temp directory, use the realpath for output
|
|
# log option
|
|
output_log=''
|
|
while getopts o: name
|
|
do
|
|
case $name in
|
|
o) output_log=$(realpath "$OPTARG")
|
|
esac
|
|
done
|
|
shift $(($OPTIND - 1))
|
|
|
|
# generate a temp directory to run compat layer script
|
|
base_dir=$(realpath $BUILDDIR/../)
|
|
cd $base_dir
|
|
|
|
build_dir=$(mktemp -p $base_dir -d -t build-XXXX)
|
|
|
|
source oe-init-build-env $build_dir
|
|
if [[ $output_log != '' ]]; then
|
|
yocto-compat-layer.py -o "$output_log" "$*"
|
|
else
|
|
yocto-compat-layer.py "$@"
|
|
fi
|
|
retcode=$?
|
|
|
|
rm -rf $build_dir
|
|
|
|
exit $retcode
|