| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # TODO(mmoss) This currently only works with official builds, since non-official | 7 # TODO(mmoss) This currently only works with official builds, since non-official |
| 8 # builds don't add the "${BUILDDIR}/installer/" files needed for packaging. | 8 # builds don't add the "${BUILDDIR}/installer/" files needed for packaging. |
| 9 | 9 |
| 10 set -e | 10 set -e |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 # Remove temporary files and unwanted packaging output. | 116 # Remove temporary files and unwanted packaging output. |
| 117 cleanup() { | 117 cleanup() { |
| 118 echo "Cleaning..." | 118 echo "Cleaning..." |
| 119 rm -rf "${STAGEDIR}" | 119 rm -rf "${STAGEDIR}" |
| 120 rm -rf "${TMPFILEDIR}" | 120 rm -rf "${TMPFILEDIR}" |
| 121 } | 121 } |
| 122 | 122 |
| 123 usage() { | 123 usage() { |
| 124 echo "usage: $(basename $0) [-c channel] [-a target_arch] [-o 'dir'] " | 124 echo "usage: $(basename $0) [-c channel] [-a target_arch] [-o 'dir'] " |
| 125 echo " [-b 'dir']" | 125 echo " [-b 'dir'] -d branding" |
| 126 echo "-c channel the package channel (trunk, asan, unstable, beta, stable)" | 126 echo "-c channel the package channel (trunk, asan, unstable, beta, stable)" |
| 127 echo "-a arch package architecture (ia32 or x64)" | 127 echo "-a arch package architecture (ia32 or x64)" |
| 128 echo "-o dir package output directory [${OUTPUTDIR}]" | 128 echo "-o dir package output directory [${OUTPUTDIR}]" |
| 129 echo "-b dir build input directory [${BUILDDIR}]" | 129 echo "-b dir build input directory [${BUILDDIR}]" |
| 130 echo "-d brand either chromium or google_chrome" |
| 130 echo "-h this help message" | 131 echo "-h this help message" |
| 131 } | 132 } |
| 132 | 133 |
| 133 # Check that the channel name is one of the allowable ones. | 134 # Check that the channel name is one of the allowable ones. |
| 134 verify_channel() { | 135 verify_channel() { |
| 135 case $CHANNEL in | 136 case $CHANNEL in |
| 136 stable ) | 137 stable ) |
| 137 CHANNEL=stable | 138 CHANNEL=stable |
| 138 RELEASENOTES="http://googlechromereleases.blogspot.com/search/label/Stable
%20updates" | 139 RELEASENOTES="http://googlechromereleases.blogspot.com/search/label/Stable
%20updates" |
| 139 ;; | 140 ;; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 154 * ) | 155 * ) |
| 155 echo | 156 echo |
| 156 echo "ERROR: '$CHANNEL' is not a valid channel type." | 157 echo "ERROR: '$CHANNEL' is not a valid channel type." |
| 157 echo | 158 echo |
| 158 exit 1 | 159 exit 1 |
| 159 ;; | 160 ;; |
| 160 esac | 161 esac |
| 161 } | 162 } |
| 162 | 163 |
| 163 process_opts() { | 164 process_opts() { |
| 164 while getopts ":o:b:c:a:h" OPTNAME | 165 while getopts ":o:b:c:a:d:h" OPTNAME |
| 165 do | 166 do |
| 166 case $OPTNAME in | 167 case $OPTNAME in |
| 167 o ) | 168 o ) |
| 168 OUTPUTDIR=$(readlink -f "${OPTARG}") | 169 OUTPUTDIR=$(readlink -f "${OPTARG}") |
| 169 mkdir -p "${OUTPUTDIR}" | 170 mkdir -p "${OUTPUTDIR}" |
| 170 ;; | 171 ;; |
| 171 b ) | 172 b ) |
| 172 BUILDDIR=$(readlink -f "${OPTARG}") | 173 BUILDDIR=$(readlink -f "${OPTARG}") |
| 173 ;; | 174 ;; |
| 174 c ) | 175 c ) |
| 175 CHANNEL="$OPTARG" | 176 CHANNEL="$OPTARG" |
| 176 ;; | 177 ;; |
| 177 a ) | 178 a ) |
| 178 TARGETARCH="$OPTARG" | 179 TARGETARCH="$OPTARG" |
| 179 ;; | 180 ;; |
| 181 d ) |
| 182 BRANDING="$OPTARG" |
| 183 ;; |
| 180 h ) | 184 h ) |
| 181 usage | 185 usage |
| 182 exit 0 | 186 exit 0 |
| 183 ;; | 187 ;; |
| 184 \: ) | 188 \: ) |
| 185 echo "'-$OPTARG' needs an argument." | 189 echo "'-$OPTARG' needs an argument." |
| 186 usage | 190 usage |
| 187 exit 1 | 191 exit 1 |
| 188 ;; | 192 ;; |
| 189 * ) | 193 * ) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 217 # call cleanup() on exit | 221 # call cleanup() on exit |
| 218 trap cleanup 0 | 222 trap cleanup 0 |
| 219 process_opts "$@" | 223 process_opts "$@" |
| 220 BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")} | 224 BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")} |
| 221 | 225 |
| 222 source ${BUILDDIR}/installer/common/installer.include | 226 source ${BUILDDIR}/installer/common/installer.include |
| 223 | 227 |
| 224 get_version_info | 228 get_version_info |
| 225 VERSIONFULL="${VERSION}-${PACKAGE_RELEASE}" | 229 VERSIONFULL="${VERSION}-${PACKAGE_RELEASE}" |
| 226 | 230 |
| 227 if [ "$CHROMIUM_BUILD" = "_google_chrome" ]; then | 231 if [ "$BRANDING" = "google_chrome" ]; then |
| 228 source "${BUILDDIR}/installer/common/google-chrome.info" | 232 source "${BUILDDIR}/installer/common/google-chrome.info" |
| 229 else | 233 else |
| 230 source "${BUILDDIR}/installer/common/chromium-browser.info" | 234 source "${BUILDDIR}/installer/common/chromium-browser.info" |
| 231 fi | 235 fi |
| 232 eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \ | 236 eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \ |
| 233 "${BUILDDIR}/installer/theme/BRANDING") | 237 "${BUILDDIR}/installer/theme/BRANDING") |
| 234 | 238 |
| 235 REPOCONFIG="deb http://dl.google.com/linux/chrome/deb/ stable main" | 239 REPOCONFIG="deb http://dl.google.com/linux/chrome/deb/ stable main" |
| 236 SSLREPOCONFIG="deb https://dl.google.com/linux/chrome/deb/ stable main" | 240 SSLREPOCONFIG="deb https://dl.google.com/linux/chrome/deb/ stable main" |
| 237 verify_channel | 241 verify_channel |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 ;; | 322 ;; |
| 319 * ) | 323 * ) |
| 320 echo | 324 echo |
| 321 echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'." | 325 echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'." |
| 322 echo | 326 echo |
| 323 exit 1 | 327 exit 1 |
| 324 ;; | 328 ;; |
| 325 esac | 329 esac |
| 326 | 330 |
| 327 do_package | 331 do_package |
| OLD | NEW |