Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # Yocto Project compatibility layer tool wrapper |
| 4 | # |
| 5 | # Creates a temprary build directory to run Yocto Project Compatible |
| 6 | # script to avoid a contaminated environment. |
| 7 | # |
| 8 | # Copyright (C) 2017 Intel Corporation |
| 9 | # Released under the MIT license (see COPYING.MIT) |
| 10 | |
| 11 | if [ -z "$BUILDDIR" ]; then |
| 12 | echo "Please source oe-init-build-env before run this script." |
| 13 | exit 2 |
| 14 | fi |
| 15 | |
| 16 | base_dir=$(realpath $BUILDDIR/../) |
| 17 | cd $base_dir |
| 18 | |
| 19 | build_dir=$(mktemp -p $base_dir -d -t build-XXXX) |
| 20 | |
| 21 | source oe-init-build-env $build_dir |
| 22 | yocto-compat-layer.py "$@" |
| 23 | retcode=$? |
| 24 | |
| 25 | rm -rf $build_dir |
| 26 | |
| 27 | exit $retcode |