diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-03-19 04:58:59 +0000 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2020-03-20 08:36:17 +0000 |
commit | 3d30597e9377f1f9e66a0c77d616b1f699fef5ef (patch) | |
tree | 8e04bfe6f6c3a1a051757c51806e7ac7be9db6c3 /frontend/lb | |
parent | 0e090a65e394c7c9c717780e4b8015844de43cb4 (diff) | |
download | vyos-live-build-3d30597e9377f1f9e66a0c77d616b1f699fef5ef.tar.gz vyos-live-build-3d30597e9377f1f9e66a0c77d616b1f699fef5ef.zip |
frontend: avoid trying to load /scripts/build.sh
unless `LIVE_BUILD` is set in the environment when running live-build,
this var will be empty. this will result in the frontend trying to load
the file '/scripts/build.sh', which is doubtful the file intended to be
loaded, if it exists. the intention of checking the path
"${LIVE_BUILD}/scripts/build.sh" is really only to do so if the var is
actually used, so let's only do so if it's non-empty.
since we use `set -e`, if build.sh is not found in either location then
failure will occur. if it is found, presuming it is the real file that we
expect to be found, this file sets the var to a default if it was an empty
string, thus we need not worry about use of the var later in the frontend
script.
also, the var is exported prior to exec'ing the command script, so we know
that in the command scripts it is not going to be empty, and those in
themselves loading build.sh which again exports the var ensures that it
will be set for subsequent loads of component scripts (which happens to
go through the frontend again, not that that matters. so except for at the
start of execution, it should never be found to be empty.
Gbp-Dch: Short
Diffstat (limited to 'frontend/lb')
-rwxr-xr-x | frontend/lb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/frontend/lb b/frontend/lb index 47193a5f1..855ec3070 100755 --- a/frontend/lb +++ b/frontend/lb @@ -12,7 +12,7 @@ set -e # Including common functions -[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh +[ -n "${LIVE_BUILD}" ] && [ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh # Setting static variables DESCRIPTION="Utility to build live systems" |