Commit 1285b168 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Fix no-brand .pkg files

If a distribution has no brand code, the created package
should work.

Fixed: 11142512
Change-Id: I6f8d939f97f91ac2607ac343aa700eec1f0edf14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2498105
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820938}
parent 9105526a
......@@ -38,21 +38,25 @@ readonly KS_ARCHIVE="${KS_REG_FRAMEWORK}/Resources/Keystone.tbz"
"${KS_INSTALL}" "--install=${KS_ARCHIVE}"
# 2. Create the brand file.
# 2. Create the brand file, if specified.
echo "Creating the brand file."
brand_file_written="false"
readonly BRAND_PLIST="/Library/Google/${APP_PRODUCT} Brand.plist"
readonly KS_BRAND_KEY="KSBrandID"
if [[ -n "${BRAND_CODE}" ]]; then
echo "Creating the brand file."
# Failure to write a brand file is less important than getting automatic updates
# configured.
brand_file_written="false"
defaults write "${BRAND_PLIST}" "${KS_BRAND_KEY}" \
-string "${BRAND_CODE}" \
&& chmod 644 "${BRAND_PLIST}" \
&& brand_file_written="true"
readonly BRAND_PLIST="/Library/Google/${APP_PRODUCT} Brand.plist"
readonly KS_BRAND_KEY="KSBrandID"
# Failure to write a brand file is less important than getting automatic
# updates configured.
defaults write "${BRAND_PLIST}" "${KS_BRAND_KEY}" \
-string "${BRAND_CODE}" \
&& chmod 644 "${BRAND_PLIST}" \
&& brand_file_written="true"
else
echo "Skipping the brand file."
fi
# 3. Register Chrome with Keystone.
......
......@@ -125,7 +125,7 @@ def _create_pkgbuild_scripts(paths, dist_config):
substitutions = {
'@APP_DIR@': dist_config.app_dir,
'@APP_PRODUCT@': dist_config.app_product,
'@BRAND_CODE@': dist_config.distribution.branding_code,
'@BRAND_CODE@': dist_config.distribution.branding_code or '',
'@FRAMEWORK_DIR@': dist_config.framework_dir
}
for key, value in substitutions.items():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment