summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-14 16:27:42 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-14 16:27:42 +0000
commita56c412b071c4370e9553f43f0abf1c7c83f89bf (patch)
tree7ea47ae3671385164017f382616d409f935c0658 /chrome/installer
parent77ee1b17830ab909e4436084db7f473531bcc042 (diff)
downloadchromium_src-a56c412b071c4370e9553f43f0abf1c7c83f89bf.zip
chromium_src-a56c412b071c4370e9553f43f0abf1c7c83f89bf.tar.gz
chromium_src-a56c412b071c4370e9553f43f0abf1c7c83f89bf.tar.bz2
Save the Keystone product ID in .patch/product_id on update disk images.
Fix MIN_BUILD. Oops. BUG=45017 TEST=none Review URL: http://codereview.chromium.org/2833002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rwxr-xr-xchrome/installer/mac/dmgdiffer.sh36
1 files changed, 23 insertions, 13 deletions
diff --git a/chrome/installer/mac/dmgdiffer.sh b/chrome/installer/mac/dmgdiffer.sh
index 9a6b6a2..b70dcc5 100755
--- a/chrome/installer/mac/dmgdiffer.sh
+++ b/chrome/installer/mac/dmgdiffer.sh
@@ -51,8 +51,9 @@
# 9 Could not create disk image
# 10 Could not read old application version
# 11 Could not read new application version
-# 12 Old or new application sanity check failure
-# 13 Could not write the patch
+# 12 Could not read product ID
+# 13 Old or new application sanity check failure
+# 14 Could not write the patch
#
# Exit codes in the range 21-40 are mapped to codes 1-20 as returned by the
# first dirdiffer invocation. Codes 41-60 are mapped to codes 1-20 as returned
@@ -142,11 +143,12 @@ make_patch_fs() {
readonly APP_NAME_RE="${PRODUCT_NAME}\\.app"
readonly APP_INFO_PLIST="Contents/Info"
readonly APP_VERSION_KEY="CFBundleShortVersionString"
+ readonly KS_PRODUCT_KEY="KSProductID"
readonly KS_CHANNEL_KEY="KSChannelID"
readonly VERSIONS_DIR="Contents/Versions"
readonly PRODUCT_URL="http://www.google.com/chrome/"
readonly BUILD_RE="^[0-9]+\\.[0-9]+\\.([0-9]+)\\.[0-9]+\$"
- readonly MIN_BUILD=375
+ readonly MIN_BUILD=434
local old_app_path="${old_fs}/${APP_NAME}"
local old_app_info_plist="${old_app_path}/${APP_INFO_PLIST}"
@@ -176,10 +178,17 @@ make_patch_fs() {
fi
local new_version_build="${BASH_REMATCH[1]}"
+ local product_id
+ if ! product_id="$(defaults read "${new_app_info_plist}" \
+ "${KS_PRODUCT_KEY}")"; then
+ err "could not read product ID"
+ exit 12
+ fi
+
if [[ ${old_version_build} -lt ${MIN_BUILD} ]] ||
[[ ${new_version_build} -lt ${MIN_BUILD} ]]; then
err "old and new versions must be build ${MIN_BUILD} or newer"
- exit 12
+ exit 13
fi
local new_ks_channel
@@ -201,44 +210,45 @@ make_patch_fs() {
if ! cp -p "${SCRIPT_DIR}/keystone_install.sh" \
"${patch_fs}/.keystone_install"; then
err "could not copy .keystone_install"
- exit 13
+ exit 14
fi
local patch_dotpatch_dir="${patch_fs}/.patch"
if ! mkdir "${patch_dotpatch_dir}"; then
err "could not mkdir patch_dotpatch_dir"
- exit 13
+ exit 14
fi
if ! cp -p "${SCRIPT_DIR}/dirpatcher.sh" \
"${SCRIPT_DIR}/goobspatch" \
"${patch_dotpatch_dir}/"; then
err "could not copy dirpatcher.sh and goobspatch"
- exit 13
+ exit 14
fi
- if ! echo "${old_version}" > "${patch_dotpatch_dir}/old_version" ||
+ if ! echo "${product_id}" > "${patch_dotpatch_dir}/product_id" ||
+ ! echo "${old_version}" > "${patch_dotpatch_dir}/old_version" ||
! echo "${new_version}" > "${patch_dotpatch_dir}/new_version"; then
- err "could not write patch version information"
- exit 13
+ err "could not write patch product or version information"
+ exit 14
fi
local patch_ks_channel_file="${patch_dotpatch_dir}/ks_channel"
if [[ -n "${new_ks_channel}" ]]; then
if ! echo "${new_ks_channel}" > "${patch_ks_channel_file}"; then
err "could not write Keystone channel information"
- exit 13
+ exit 14
fi
else
if ! touch "${patch_ks_channel_file}"; then
err "could not write empty Keystone channel information"
- exit 13
+ exit 14
fi
fi
# The only visible contents of the disk image will be a README file that
# explains the image's purpose.
cat > "${patch_fs}/README.txt" << __EOF__ || \
- (err "could not write README.txt" && exit 13)
+ (err "could not write README.txt" && exit 14)
This disk image contains a differential updater that can update
${PRODUCT_NAME} from version ${old_version} to ${new_version}${name_extra}.