From 14646f79007dc5c141efbc130225b61c8b3ed7c6 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 1 Dec 2015 12:44:38 -0800 Subject: [PATCH] common: set properly COREOS_SDK_VERSION Broken in 0b6acf86 when we started selectively reading version.txt --- common.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common.sh b/common.sh index a1e526b0ea..8d22d0aa65 100644 --- a/common.sh +++ b/common.sh @@ -242,10 +242,12 @@ load_environment_whitelist() { } load_environment_var() { - local file="$1" name="$2" - local value + local file="$1" name value + shift + for name in "$@"; do value=$(grep "^${name}=" "${file}") export "${value}" + done } # Find root of source tree @@ -273,13 +275,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 + 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. : ${COREOS_BUILD_ID:=$(date +%Y-%m-%d-%H%M)} elif [[ -f "${SCRIPT_LOCATION}/version.txt" ]]; then - load_environment_var "${SCRIPT_LOCATION}/version.txt" COREOS_VERSION_ID # This only happens in update.zip where we must use the current build id. - load_environment_var "${SCRIPT_LOCATION}/version.txt" COREOS_BUILD_ID + load_environment_var "${SCRIPT_LOCATION}/version.txt" \ + COREOS_VERSION_ID COREOS_BUILD_ID COREOS_SDK_VERSION else die "Unable to locate version.txt" fi