aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-12-09 19:26:48 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-13 22:47:32 +0000
commitac7a905b18acb8bd9b2412b6682afbe1d7e18d7b (patch)
tree3d26f0da10af6136aba7f42b9c6cbbe0fb82f575 /scripts
parentd212e97aeae502cd0d11cb922f7711aee5c1ace0 (diff)
downloadopenembedded-core-contrib-ac7a905b18acb8bd9b2412b6682afbe1d7e18d7b.tar.gz
openembedded-core-contrib-ac7a905b18acb8bd9b2412b6682afbe1d7e18d7b.tar.bz2
openembedded-core-contrib-ac7a905b18acb8bd9b2412b6682afbe1d7e18d7b.zip
oe-buildenv-internal: show usage output
Show usage text if script is not sourced. Tested in bash, zsh and dash. [YOCTO #10751] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/oe-buildenv-internal12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 9fae3b4ec3f..c8905524ff5 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -18,6 +18,18 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+if ! $(return >/dev/null 2>&1) ; then
+ echo 'oe-buildenv-internal: error: this script must be sourced'
+ echo ''
+ echo 'Usage: . $OEROOT/scripts/oe-buildenv-internal &&'
+ echo ''
+ echo 'OpenEmbedded oe-buildenv-internal - an internal script that is'
+ echo 'used in oe-init-build-env and oe-init-build-env-memres to'
+ echo 'initialize oe build environment'
+ echo ''
+ exit 2
+fi
+
# It is assumed OEROOT is already defined when this is called
if [ -z "$OEROOT" ]; then
echo >&2 "Error: OEROOT is not defined!"