From dbc853b2bfe8a941dd0eac93a84f243be8d89bad Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Mon, 9 Apr 2012 15:07:47 -0700 Subject: [PATCH] Add an advanced option to build_image so that a caller can specify the version. This change adds the ability for a caller to pass a specific version name to build_image rather than rely on parsing of chromeos_version.sh + attempt number. BUG=chromium-os:29077 TEST=Ran build_image w/ w/out option Change-Id: I69b76ae4bfc148325686902606476a0aae293e56 Reviewed-on: https://gerrit.chromium.org/gerrit/19861 Tested-by: Chris Sosa Reviewed-by: David James Commit-Ready: Chris Sosa --- build_image | 2 ++ build_library/build_image_util.sh | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build_image b/build_image index 67564d96bb..fc6dd05c57 100755 --- a/build_image +++ b/build_image @@ -62,6 +62,8 @@ show_help_if_requested "$@" # not needed for the typical developer workflow. DEFINE_integer build_attempt 1 \ "The build attempt for this image build." +DEFINE_string version "" \ + "Overrides version number in name to this version." DEFINE_integer jobs -1 \ "How many packages to build in parallel at maximum." DEFINE_boolean replace ${FLAGS_FALSE} \ diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index 172e9ef041..d2cbfebee6 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -11,8 +11,13 @@ # Use canonical path since some tools (e.g. mount) do not like symlinks. # Append build attempt to output directory. -IMAGE_SUBDIR="R${CHROME_BRANCH}-${CHROMEOS_VERSION_STRING}-a\ +IMAGE_SUBDIR="R${CHROME_BRANCH}" +if [ -z "${FLAGS_version}" ]; then + IMAGE_SUBDIR="${IMAGE_SUBDIR}-${CHROMEOS_VERSION_STRING}-a\ ${FLAGS_build_attempt}" +else + IMAGE_SUBDIR="${IMAGE_SUBDIR}-${FLAGS_version}" +fi BUILD_DIR="${FLAGS_output_root}/${BOARD}/${IMAGE_SUBDIR}" OUTSIDE_OUTPUT_DIR="../build/images/${BOARD}/${IMAGE_SUBDIR}" IMAGES_TO_BUILD=