From 12935743b63fbe3432c182f11cdd5b24b45d5c0d Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 8 Jul 2013 18:30:10 -0700 Subject: [PATCH] fix(common.sh): Fallback to loading version.txt from current directory. This makes version handling continue to work normally with au-generator.zip --- build_library/generate_au_zip.py | 1 + common.sh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build_library/generate_au_zip.py b/build_library/generate_au_zip.py index 61717eb73c..d943d73f05 100755 --- a/build_library/generate_au_zip.py +++ b/build_library/generate_au_zip.py @@ -19,6 +19,7 @@ import tempfile # GLOBALS STATIC_FILES = ['/usr/bin/old_bins/cgpt', '/usr/bin/cros_generate_update_payload', + '~/trunk/.repo/manifests/version.txt', '~/trunk/src/scripts/chromeos-common.sh', '~/trunk/src/scripts/common.sh', ] diff --git a/common.sh b/common.sh index a72e7a8451..010334b33b 100644 --- a/common.sh +++ b/common.sh @@ -305,7 +305,10 @@ BUILD_LIBRARY_DIR="${SCRIPTS_DIR}/build_library" # Source COREOS_* from manifest for version information. COREOS_VERSION_FILE="${GCLIENT_ROOT}/.repo/manifests/version.txt" -source "$COREOS_VERSION_FILE" || die "Cannot source $COREOS_VERSION_FILE" +if [[ ! -f "${COREOS_VERSION_FILE}" ]]; then + COREOS_VERSION_FILE="${SCRIPT_LOCATION}/version.txt" +fi +source "$COREOS_VERSION_FILE" || die "Cannot source version.txt" # Official builds must set COREOS_OFFICIAL=1 to use an official version. if [ ${COREOS_OFFICIAL:-0} -ne 1 ]; then