fix(common.sh): Fallback to loading version.txt from current directory.

This makes version handling continue to work normally with
au-generator.zip
This commit is contained in:
Michael Marineau 2013-07-08 18:30:10 -07:00
parent 12149d8421
commit 12935743b6
2 changed files with 5 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import tempfile
# GLOBALS # GLOBALS
STATIC_FILES = ['/usr/bin/old_bins/cgpt', STATIC_FILES = ['/usr/bin/old_bins/cgpt',
'/usr/bin/cros_generate_update_payload', '/usr/bin/cros_generate_update_payload',
'~/trunk/.repo/manifests/version.txt',
'~/trunk/src/scripts/chromeos-common.sh', '~/trunk/src/scripts/chromeos-common.sh',
'~/trunk/src/scripts/common.sh', '~/trunk/src/scripts/common.sh',
] ]

View File

@ -305,7 +305,10 @@ BUILD_LIBRARY_DIR="${SCRIPTS_DIR}/build_library"
# Source COREOS_* from manifest for version information. # Source COREOS_* from manifest for version information.
COREOS_VERSION_FILE="${GCLIENT_ROOT}/.repo/manifests/version.txt" 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. # Official builds must set COREOS_OFFICIAL=1 to use an official version.
if [ ${COREOS_OFFICIAL:-0} -ne 1 ]; then if [ ${COREOS_OFFICIAL:-0} -ne 1 ]; then