Skip to content

frontend: avoid trying to load /scripts/build.sh

Lyndon Brown requested to merge jnqnfe/live-build:load_buildsh into master

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

Merge request reports

Loading