summaryrefslogtreecommitdiffstats
path: root/scripts/yocto-check-layer-wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/yocto-check-layer-wrapper')
-rwxr-xr-xscripts/yocto-check-layer-wrapper43
1 files changed, 43 insertions, 0 deletions
diff --git a/scripts/yocto-check-layer-wrapper b/scripts/yocto-check-layer-wrapper
new file mode 100755
index 0000000000..bbf6ee176d
--- /dev/null
+++ b/scripts/yocto-check-layer-wrapper
@@ -0,0 +1,43 @@
1#!/usr/bin/env bash
2
3# Yocto Project layer check tool wrapper
4#
5# Creates a temporary build directory to run the yocto-check-layer
6# script to avoid a contaminated environment.
7#
8# Copyright (C) 2017 Intel Corporation
9# Released under the MIT license (see COPYING.MIT)
10
11if [ -z "$BUILDDIR" ]; then
12 echo "Please source oe-init-build-env before run this script."
13 exit 2
14fi
15
16# since we are using a temp directory, use the realpath for output
17# log option
18output_log=''
19while getopts o: name
20do
21 case $name in
22 o) output_log=$(realpath "$OPTARG")
23 esac
24done
25shift $(($OPTIND - 1))
26
27# generate a temp directory to run check layer script
28base_dir=$(realpath $BUILDDIR/../)
29cd $base_dir
30
31build_dir=$(mktemp -p $base_dir -d -t build-XXXX)
32
33source oe-init-build-env $build_dir
34if [[ $output_log != '' ]]; then
35 yocto-check-layer -o "$output_log" "$*"
36else
37 yocto-check-layer "$@"
38fi
39retcode=$?
40
41rm -rf $build_dir
42
43exit $retcode