| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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'] -d branding" | 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 "-d brand either chromium or google_chrome" |
| 131 echo "-s dir /path/to/sysroot" | 131 echo "-s dir /path/to/sysroot" |
| 132 echo "-e dir /path/to/dpkg-dev" | |
| 133 echo "-h this help message" | 132 echo "-h this help message" |
| 134 } | 133 } |
| 135 | 134 |
| 136 # Check that the channel name is one of the allowable ones. | 135 # Check that the channel name is one of the allowable ones. |
| 137 verify_channel() { | 136 verify_channel() { |
| 138 case $CHANNEL in | 137 case $CHANNEL in |
| 139 stable ) | 138 stable ) |
| 140 CHANNEL=stable | 139 CHANNEL=stable |
| 141 RELEASENOTES="http://googlechromereleases.blogspot.com/search/label/Stable
%20updates" | 140 RELEASENOTES="http://googlechromereleases.blogspot.com/search/label/Stable
%20updates" |
| 142 ;; | 141 ;; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 157 * ) | 156 * ) |
| 158 echo | 157 echo |
| 159 echo "ERROR: '$CHANNEL' is not a valid channel type." | 158 echo "ERROR: '$CHANNEL' is not a valid channel type." |
| 160 echo | 159 echo |
| 161 exit 1 | 160 exit 1 |
| 162 ;; | 161 ;; |
| 163 esac | 162 esac |
| 164 } | 163 } |
| 165 | 164 |
| 166 process_opts() { | 165 process_opts() { |
| 167 while getopts ":e:s:o:b:c:a:d:h" OPTNAME | 166 while getopts ":s:o:b:c:a:d:h" OPTNAME |
| 168 do | 167 do |
| 169 case $OPTNAME in | 168 case $OPTNAME in |
| 170 o ) | 169 o ) |
| 171 OUTPUTDIR=$(readlink -f "${OPTARG}") | 170 OUTPUTDIR=$(readlink -f "${OPTARG}") |
| 172 mkdir -p "${OUTPUTDIR}" | 171 mkdir -p "${OUTPUTDIR}" |
| 173 ;; | 172 ;; |
| 174 b ) | 173 b ) |
| 175 BUILDDIR=$(readlink -f "${OPTARG}") | 174 BUILDDIR=$(readlink -f "${OPTARG}") |
| 176 ;; | 175 ;; |
| 177 c ) | 176 c ) |
| 178 CHANNEL="$OPTARG" | 177 CHANNEL="$OPTARG" |
| 179 ;; | 178 ;; |
| 180 a ) | 179 a ) |
| 181 TARGETARCH="$OPTARG" | 180 TARGETARCH="$OPTARG" |
| 182 ;; | 181 ;; |
| 183 d ) | 182 d ) |
| 184 BRANDING="$OPTARG" | 183 BRANDING="$OPTARG" |
| 185 ;; | 184 ;; |
| 186 s ) | 185 s ) |
| 187 SYSROOT="$OPTARG" | 186 SYSROOT="$OPTARG" |
| 188 ;; | 187 ;; |
| 189 e ) | |
| 190 DPKG_DEV_DIR="$OPTARG" | |
| 191 ;; | |
| 192 h ) | 188 h ) |
| 193 usage | 189 usage |
| 194 exit 0 | 190 exit 0 |
| 195 ;; | 191 ;; |
| 196 \: ) | 192 \: ) |
| 197 echo "'-$OPTARG' needs an argument." | 193 echo "'-$OPTARG' needs an argument." |
| 198 usage | 194 usage |
| 199 exit 1 | 195 exit 1 |
| 200 ;; | 196 ;; |
| 201 * ) | 197 * ) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 SAVE_LDLP=${LD_LIBRARY_PATH:-} | 271 SAVE_LDLP=${LD_LIBRARY_PATH:-} |
| 276 unset LD_LIBRARY_PATH | 272 unset LD_LIBRARY_PATH |
| 277 if [ ${TARGETARCH} = "x64" ]; then | 273 if [ ${TARGETARCH} = "x64" ]; then |
| 278 SHLIB_ARGS="-l${SYSROOT}/usr/lib/x86_64-linux-gnu" | 274 SHLIB_ARGS="-l${SYSROOT}/usr/lib/x86_64-linux-gnu" |
| 279 SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/lib/x86_64-linux-gnu" | 275 SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/lib/x86_64-linux-gnu" |
| 280 else | 276 else |
| 281 SHLIB_ARGS="-l${SYSROOT}/usr/lib/i386-linux-gnu" | 277 SHLIB_ARGS="-l${SYSROOT}/usr/lib/i386-linux-gnu" |
| 282 SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/lib/i386-linux-gnu" | 278 SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/lib/i386-linux-gnu" |
| 283 fi | 279 fi |
| 284 SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/usr/lib" | 280 SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/usr/lib" |
| 285 # TODO(thomasanderson): Unbundle dpkg-shlibdeps once the Precise->Trusty | 281 DPKG_SHLIB_DEPS=$(cd ${SYSROOT} && dpkg-shlibdeps ${SHLIB_ARGS:-} -O \ |
| 286 # transition is complete by reverting CL 2411423002 and applying ps40001. | 282 -e"$BUILDDIR/chrome" | sed 's/^shlibs:Depends=//') |
| 287 DPKG_SHLIB_DEPS=$(cd ${SYSROOT} && DPKG_DATADIR=${DPKG_DEV_DIR} \ | |
| 288 perl -I ${DPKG_DEV_DIR}/scripts ${DPKG_DEV_DIR}/scripts/dpkg-shlibdeps.pl \ | |
| 289 ${SHLIB_ARGS:-} -O -e"$BUILDDIR/chrome" | sed 's/^shlibs:Depends=//') | |
| 290 if [ -n "$SAVE_LDLP" ]; then | 283 if [ -n "$SAVE_LDLP" ]; then |
| 291 LD_LIBRARY_PATH=$SAVE_LDLP | 284 LD_LIBRARY_PATH=$SAVE_LDLP |
| 292 fi | 285 fi |
| 293 | 286 |
| 294 # Format it nicely and save it for comparison. | 287 # Format it nicely and save it for comparison. |
| 295 echo "$DPKG_SHLIB_DEPS" | sed 's/, /\n/g' | LANG=C sort > actual | 288 echo "$DPKG_SHLIB_DEPS" | sed 's/, /\n/g' | LANG=C sort > actual |
| 296 | 289 |
| 297 # Compare the expected dependency list to the generated list. | 290 # Compare the expected dependency list to the generated list. |
| 298 BAD_DIFF=0 | 291 BAD_DIFF=0 |
| 299 diff -u "$SCRIPTDIR/expected_deps_${TARGETARCH}_${TARGET_DISTRO}" actual || \ | 292 diff -u "$SCRIPTDIR/expected_deps_${TARGETARCH}_${TARGET_DISTRO}" actual || \ |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 # Only use the default REPOCONFIG if it's unset (e.g. verify_channel might have | 349 # Only use the default REPOCONFIG if it's unset (e.g. verify_channel might have |
| 357 # set it to an empty string) | 350 # set it to an empty string) |
| 358 REPOCONFIG="${REPOCONFIG-deb [arch=${ARCHITECTURE}] http://${BASEREPOCONFIG}}" | 351 REPOCONFIG="${REPOCONFIG-deb [arch=${ARCHITECTURE}] http://${BASEREPOCONFIG}}" |
| 359 # Allowed configs include optional HTTPS support and explicit multiarch | 352 # Allowed configs include optional HTTPS support and explicit multiarch |
| 360 # platforms. | 353 # platforms. |
| 361 REPOCONFIGREGEX="deb (\\\\[arch=[^]]*\\\\b${ARCHITECTURE}\\\\b[^]]*\\\\]" | 354 REPOCONFIGREGEX="deb (\\\\[arch=[^]]*\\\\b${ARCHITECTURE}\\\\b[^]]*\\\\]" |
| 362 REPOCONFIGREGEX+="[[:space:]]*) https?://${BASEREPOCONFIG}" | 355 REPOCONFIGREGEX+="[[:space:]]*) https?://${BASEREPOCONFIG}" |
| 363 stage_install_debian | 356 stage_install_debian |
| 364 | 357 |
| 365 do_package | 358 do_package |
| OLD | NEW |