load_environment_var: Pickup COREOS_BUILD_ID

Change the setting of COREOS_BUILD_ID so that its value, in order of
preference, is set to

  A value set in the environment.
  A value provided in manifest's version.txt.
  A fall back value of the current time-date.

Signed-off-by: Geoff Levand <geoff@infradead.org>
This commit is contained in:
Geoff Levand 2017-03-20 15:36:03 -07:00
parent aa259bf685
commit 5a76e4e5e9

View File

@ -289,9 +289,14 @@ REPO_MANIFESTS_DIR="${REPO_ROOT}/.repo/manifests"
# Source COREOS_VERSION_ID from manifest.
if [[ -f "${REPO_MANIFESTS_DIR}/version.txt" ]]; then
load_environment_var "${REPO_MANIFESTS_DIR}/version.txt" \
COREOS_VERSION_ID COREOS_SDK_VERSION
# The build id may be provided externally by the build system.
if [[ -n ${COREOS_BUILD_ID} ]]; then
load_environment_var "${REPO_MANIFESTS_DIR}/version.txt" \
COREOS_VERSION_ID COREOS_SDK_VERSION
else
load_environment_var "${REPO_MANIFESTS_DIR}/version.txt" \
COREOS_VERSION_ID COREOS_BUILD_ID COREOS_SDK_VERSION
fi
: ${COREOS_BUILD_ID:=$(date +%Y-%m-%d-%H%M)}
elif [[ -f "${SCRIPT_LOCATION}/version.txt" ]]; then
# This only happens in update.zip where we must use the current build id.