From 98bccaf8f143ceeda0f3fafbbfbff40a208c82d3 Mon Sep 17 00:00:00 2001 From: David McMahon Date: Wed, 9 Dec 2009 10:44:45 -0800 Subject: [PATCH] Deal with empty build_number in archive_build.sh. Set and pass-thru REAL_USER for use in chroots. Remove extraneous CHROMEOS_VERSION_* settings from chromeos_version.sh. Review URL: http://codereview.chromium.org/471008 --- archive_build.sh | 6 +++++- build_image.sh | 1 + chromeos_version.sh | 5 ----- customize_rootfs.sh | 12 +++++++----- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/archive_build.sh b/archive_build.sh index fb5180c611..5881e0a755 100755 --- a/archive_build.sh +++ b/archive_build.sh @@ -50,7 +50,11 @@ REVISION=${REVISION:0:8} # Use the version number plus revision as the last change. (Need both, since # trunk builds multiple times with the same version string.) -LAST_CHANGE="${CHROMEOS_VERSION_STRING}-r${REVISION}-b${FLAGS_build_number}" +LAST_CHANGE="${CHROMEOS_VERSION_STRING}-r${REVISION}" +if [ -n "$FLAGS_build_number" ] +then + LAST_CHANGE="$LAST_CHANGE-b${FLAGS_build_number}" +fi # The Chromium buildbot scripts only create a clickable link to the archive # if an output line of the form "last change: XXX" exists diff --git a/build_image.sh b/build_image.sh index 3bb5221c7e..02d876a2bc 100755 --- a/build_image.sh +++ b/build_image.sh @@ -208,6 +208,7 @@ MIRROR2_INSIDE="${FLAGS_mirror2/$GCLIENT_ROOT//trunk}" # Write options for customize script into the chroot CUST_OPTS="${SETUP_DIR}/customize_opts.sh" cat < $CUST_OPTS +REAL_USER=$USER SETUP_DIR="$ROOTFS_SETUP_DIR" KERNEL_VERSION="$KERNEL_VERSION" SERVER="$MIRROR_INSIDE" diff --git a/chromeos_version.sh b/chromeos_version.sh index 9fe4077cdb..a6d0695e57 100755 --- a/chromeos_version.sh +++ b/chromeos_version.sh @@ -21,11 +21,6 @@ HOSTNAME=$(hostname) export CHROMEOS_VERSION_MAJOR=0 export CHROMEOS_VERSION_MINOR=5 -# Major/minor versions. -# Primarily for product marketing. -export CHROMEOS_VERSION_MAJOR=0 -export CHROMEOS_VERSION_MINOR=5 - # Branch number. # Increment by 1 in a new release branch. # Increment by 2 in trunk after making a release branch. diff --git a/customize_rootfs.sh b/customize_rootfs.sh index 1014d9f86d..e5e93bdee3 100755 --- a/customize_rootfs.sh +++ b/customize_rootfs.sh @@ -42,14 +42,16 @@ fi # Set CHROMEOS_VERSION_DESCRIPTION here (uses vars set in chromeos_version.sh) # Was removed from chromeos_version.sh which can also be run outside of chroot # where CHROMEOS_REVISION is set +# We have to set (in build_image.sh) and use REAL_USER due to many nested +# chroots which lose $USER state. if [ ${CHROMEOS_OFFICIAL:-0} = 1 ]; then - export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Official Build ${CHROMEOS_REVISION:?})" -elif [ "$USER" = "chrome-bot" ] + export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Official Build ${CHROMEOS_REVISION:?})" +elif [ "$REAL_USER" = "chrome-bot" ] then - export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Continuous Build ${CHROMEOS_REVISION:?} - Builder: ${BUILDBOT_BUILD:-"N/A"})" + export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Continuous Build ${CHROMEOS_REVISION:?} - Builder: ${BUILDBOT_BUILD:-"N/A"})" else - # Use the $USER passthru via $CHROMEOS_RELEASE_CODENAME - export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Developer Build ${CHROMEOS_REVISION:?} - $(date) - $CHROMEOS_RELEASE_CODENAME)" + # Use the $USER passthru via $CHROMEOS_RELEASE_CODENAME + export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Developer Build ${CHROMEOS_REVISION:?} - $(date) - $CHROMEOS_RELEASE_CODENAME)" fi # Set google-specific version numbers: