[oe-commits] [openembedded-core] 44/63: oe-buildenv-internal: show usage output
git at git.openembedded.org
git at git.openembedded.org
Tue Dec 13 22:57:02 UTC 2016
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit ac7a905b18acb8bd9b2412b6682afbe1d7e18d7b
Author: Ed Bartosh <ed.bartosh at linux.intel.com>
AuthorDate: Fri Dec 9 19:26:48 2016 +0200
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 at linux.intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
scripts/oe-buildenv-internal | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 9fae3b4..c890552 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!"
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list