Commit 456af675 authored by Michael Moss's avatar Michael Moss

Add support for SSL-based DEB repo.

This doesn't force use of the SSL repo, but prevents overwriting the
repo config if a user manually changes it to use HTTPS.

R=thestig@chromium.org, thestig@google.com
BUG=433450,474100

Review URL: https://codereview.chromium.org/1068323002

Cr-Commit-Position: refs/heads/master@{#324317}
parent cf0c3c35
......@@ -87,7 +87,7 @@ update_bad_sources() {
ACTIVECONFIGS=$(grep -v "^[[:space:]]*\(#.*\)\?$" "$SOURCELIST" 2>/dev/null)
# Check if the correct repository configuration is in there.
REPOMATCH=$(grep "^[[:space:]#]*\b$REPOCONFIG\b" "$SOURCELIST" \
REPOMATCH=$(grep -E "^[[:space:]#]*\b($REPOCONFIG|$SSLREPOCONFIG)\b" "$SOURCELIST" \
2>/dev/null)
# Check if the correct repository is disabled.
......@@ -174,9 +174,9 @@ handle_distro_upgrade() {
find_apt_sources
SOURCELIST="$APT_SOURCESDIR/@@PACKAGE@@.list"
if [ -r "$SOURCELIST" ]; then
REPOLINE=$(grep -E "^[[:space:]]*#[[:space:]]*$REPOCONFIG[[:space:]]*# disabled on upgrade to .*" "$SOURCELIST")
REPOLINE=$(grep -E "^[[:space:]]*#[[:space:]]*($REPOCONFIG|$SSLREPOCONFIG)[[:space:]]*# disabled on upgrade to .*" "$SOURCELIST")
if [ $? -eq 0 ]; then
sed -i -e "s,^[[:space:]]*#[[:space:]]*\($REPOCONFIG\)[[:space:]]*# disabled on upgrade to .*,\1," \
sed -i -e "s,^[[:space:]]*#[[:space:]]*\($REPOCONFIG\|$SSLREPOCONFIG\)[[:space:]]*# disabled on upgrade to .*,\1," \
"$SOURCELIST"
LOGGER=$(which logger 2> /dev/null)
if [ "$LOGGER" ]; then
......
......@@ -73,6 +73,7 @@ process_template() (
-e "s#@@MAINTNAME@@#${MAINTNAME}#g" \
-e "s#@@MAINTMAIL@@#${MAINTMAIL}#g" \
-e "s#@@REPOCONFIG@@#${REPOCONFIG}#g" \
-e "s#@@SSLREPOCONFIG@@#${SSLREPOCONFIG}#g" \
-e "s#@@SHORTDESC@@#${SHORTDESC}#g" \
-e "s#@@FULLDESC@@#${FULLDESC}#g" \
-e "s#@@DEFAULT_FLAGS@@#${DEFAULT_FLAGS:-}#g" \
......
......@@ -3,3 +3,4 @@ DEFAULTS_FILE="/etc/default/@@PACKAGE@@"
# sources.list setting for @@PACKAGE@@ updates.
REPOCONFIG="@@REPOCONFIG@@"
SSLREPOCONFIG="@@SSLREPOCONFIG@@"
......@@ -233,6 +233,7 @@ eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \
"${BUILDDIR}/installer/theme/BRANDING")
REPOCONFIG="deb http://dl.google.com/linux/chrome/deb/ stable main"
SSLREPOCONFIG="deb https://dl.google.com/linux/chrome/deb/ stable main"
verify_channel
# Some Debian packaging tools want these set.
......
......@@ -281,6 +281,7 @@ eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \
"${BUILDDIR}/installer/theme/BRANDING")
REPOCONFIG="http://dl.google.com/linux/${PACKAGE#google-}/rpm/stable"
SSLREPOCONFIG="https://dl.google.com/linux/${PACKAGE#google-}/rpm/stable"
verify_channel
export USR_BIN_SYMLINK_NAME="${PACKAGE}-${CHANNEL}"
......
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