From aca1168bf98941d8bcbf4ce79e09be17403f8303 Mon Sep 17 00:00:00 2001 From: Lauri Tirkkonen Date: Sun, 28 Jan 2018 11:28:00 +0200 Subject: [PATCH] nightly: implicitly use env.sh from the same dir if not given --- docs/how-to-build.md | 7 +++---- tools/nightly.sh | 17 +++++++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/how-to-build.md b/docs/how-to-build.md index 5f35734d2c..13f5bccf35 100644 --- a/docs/how-to-build.md +++ b/docs/how-to-build.md @@ -28,7 +28,7 @@ Build For a complete build, use 'tools/nightly.sh': ``` -$ ./tools/nightly.sh tools/env.sh +$ ./tools/nightly.sh ``` On success, this results in installable packages in the `packages` directory. @@ -36,8 +36,6 @@ On success, this results in installable packages in the `packages` directory. Incremental build ----------------- -Rebuilding a component is the easiest after a full nightly build. - To build a component that is using the new build system (e.g., cat(1)), change into the source directory and run make. For example: @@ -53,7 +51,8 @@ against libraries and headers in the "proto area" or in object directories is not currently supported. To build a component under the legacy (dmake) build system, ie. things under -'usr/src': +'usr/src', first complete a full nightly build so that prerequisite objects for +the component are made, and then: ``` $ ./tools/bldenv.sh diff --git a/tools/nightly.sh b/tools/nightly.sh index 0101455a69..d5e45341e6 100755 --- a/tools/nightly.sh +++ b/tools/nightly.sh @@ -309,7 +309,7 @@ if [ "$OPTHOME" = "" ]; then export OPTHOME fi -USAGE='Usage: nightly [-in] [-V VERS ] +USAGE='Usage: nightly [-in] [-V VERS ] [env_file] Where: -i Fast incremental options (no clobber, check) @@ -388,8 +388,9 @@ shift `expr $OPTIND - 1` # test that the path to the environment-setting file was given if [ $# -ne 1 ]; then - echo "$USAGE" - exit 1 + envfile=$(dirname $0)/env.sh +else + envfile=$1 fi # @@ -445,14 +446,10 @@ unset ONBLD_TOOLS # # Setup environmental variables # -if [ -f $1 ]; then - if [[ $1 = */* ]]; then - . $1 - else - . ./$1 - fi +if [ -f $envfile ]; then + . $envfile else - echo "Cannot find env file as either $1" + echo "Cannot find env file $envfile" exit 1 fi -- 2.11.4.GIT