* [PATCH] oe-buildenv-internal: show usage output
@ 2016-12-09 17:26 Ed Bartosh
0 siblings, 0 replies; only message in thread
From: Ed Bartosh @ 2016-12-09 17:26 UTC (permalink / raw)
To: openembedded-core
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>
---
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!"
--
2.1.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-12-09 17:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-09 17:26 [PATCH] oe-buildenv-internal: show usage output Ed Bartosh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox