Chromium Code Reviews| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 fakeroot dpkg-deb -Zxz -z9 -b "${STAGEDIR}" . | 113 fakeroot dpkg-deb -Zxz -z9 -b "${STAGEDIR}" . |
| 114 } | 114 } |
| 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() { |
|
Lei Zhang
2016/10/06 18:49:20
Update?
| |
| 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 "-h this help message" | 131 echo "-h this help message" |
| 132 } | 132 } |
| 133 | 133 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 155 * ) | 155 * ) |
| 156 echo | 156 echo |
| 157 echo "ERROR: '$CHANNEL' is not a valid channel type." | 157 echo "ERROR: '$CHANNEL' is not a valid channel type." |
| 158 echo | 158 echo |
| 159 exit 1 | 159 exit 1 |
| 160 ;; | 160 ;; |
| 161 esac | 161 esac |
| 162 } | 162 } |
| 163 | 163 |
| 164 process_opts() { | 164 process_opts() { |
| 165 while getopts ":o:b:c:a:d:h" OPTNAME | 165 while getopts ":s:o:b:c:a:d:h" OPTNAME |
| 166 do | 166 do |
| 167 case $OPTNAME in | 167 case $OPTNAME in |
| 168 o ) | 168 o ) |
| 169 OUTPUTDIR=$(readlink -f "${OPTARG}") | 169 OUTPUTDIR=$(readlink -f "${OPTARG}") |
| 170 mkdir -p "${OUTPUTDIR}" | 170 mkdir -p "${OUTPUTDIR}" |
| 171 ;; | 171 ;; |
| 172 b ) | 172 b ) |
| 173 BUILDDIR=$(readlink -f "${OPTARG}") | 173 BUILDDIR=$(readlink -f "${OPTARG}") |
| 174 ;; | 174 ;; |
| 175 c ) | 175 c ) |
| 176 CHANNEL="$OPTARG" | 176 CHANNEL="$OPTARG" |
| 177 ;; | 177 ;; |
| 178 a ) | 178 a ) |
| 179 TARGETARCH="$OPTARG" | 179 TARGETARCH="$OPTARG" |
| 180 ;; | 180 ;; |
| 181 d ) | 181 d ) |
| 182 BRANDING="$OPTARG" | 182 BRANDING="$OPTARG" |
| 183 ;; | 183 ;; |
| 184 s ) | |
| 185 SYSROOT="$OPTARG" | |
| 186 ;; | |
| 184 h ) | 187 h ) |
| 185 usage | 188 usage |
| 186 exit 0 | 189 exit 0 |
| 187 ;; | 190 ;; |
| 188 \: ) | 191 \: ) |
| 189 echo "'-$OPTARG' needs an argument." | 192 echo "'-$OPTARG' needs an argument." |
| 190 usage | 193 usage |
| 191 exit 1 | 194 exit 1 |
| 192 ;; | 195 ;; |
| 193 * ) | 196 * ) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 | 260 |
| 258 # Generate the dependencies, | 261 # Generate the dependencies, |
| 259 # TODO(mmoss): This is a workaround for a problem where dpkg-shlibdeps was | 262 # TODO(mmoss): This is a workaround for a problem where dpkg-shlibdeps was |
| 260 # resolving deps using some of our build output shlibs (i.e. | 263 # resolving deps using some of our build output shlibs (i.e. |
| 261 # out/Release/lib.target/libfreetype.so.6), and was then failing with: | 264 # out/Release/lib.target/libfreetype.so.6), and was then failing with: |
| 262 # dpkg-shlibdeps: error: no dependency information found for ... | 265 # dpkg-shlibdeps: error: no dependency information found for ... |
| 263 # It's not clear if we ever want to look in LD_LIBRARY_PATH to resolve deps, | 266 # It's not clear if we ever want to look in LD_LIBRARY_PATH to resolve deps, |
| 264 # but it seems that we don't currently, so this is the most expediant fix. | 267 # but it seems that we don't currently, so this is the most expediant fix. |
| 265 SAVE_LDLP=${LD_LIBRARY_PATH:-} | 268 SAVE_LDLP=${LD_LIBRARY_PATH:-} |
| 266 unset LD_LIBRARY_PATH | 269 unset LD_LIBRARY_PATH |
| 267 DPKG_SHLIB_DEPS=$(dpkg-shlibdeps -O "$BUILDDIR/chrome" | \ | 270 if [[ -n ${SYSROOT:-} ]]; then |
| 271 SHLIB_ARGS="--admindir=${SYSROOT}/var/lib/dpkg" | |
| 272 fi | |
| 273 DPKG_SHLIB_DEPS=$(dpkg-shlibdeps ${SHLIB_ARGS:-} -O "$BUILDDIR/chrome" | \ | |
| 268 sed 's/^shlibs:Depends=//') | 274 sed 's/^shlibs:Depends=//') |
| 269 if [ -n "$SAVE_LDLP" ]; then | 275 if [ -n "$SAVE_LDLP" ]; then |
| 270 LD_LIBRARY_PATH=$SAVE_LDLP | 276 LD_LIBRARY_PATH=$SAVE_LDLP |
| 271 fi | 277 fi |
| 272 | 278 |
| 273 # Format it nicely and save it for comparison. | 279 # Format it nicely and save it for comparison. |
| 274 # The grep -v is for a duplicate libc6 dep caused by Lucid glibc silliness. | 280 # The grep -v is for a duplicate libc6 dep caused by Lucid glibc silliness. |
|
Lei Zhang
2016/10/06 18:49:20
Can you also check if this can be removed?
| |
| 275 echo "$DPKG_SHLIB_DEPS" | sed 's/, /\n/g' | \ | 281 echo "$DPKG_SHLIB_DEPS" | sed 's/, /\n/g' | \ |
| 276 grep -v '^libc6 (>= 2.3.6-6~)$' | LANG=C sort > actual | 282 grep -v '^libc6 (>= 2.3.6-6~)$' | LANG=C sort > actual |
| 277 | 283 |
| 278 # Compare the expected dependency list to the generate list. | 284 # Compare the expected dependency list to the generate list. |
| 279 BAD_DIFF=0 | 285 BAD_DIFF=0 |
| 280 diff -u "$SCRIPTDIR/expected_deps_$TARGETARCH" actual || BAD_DIFF=1 | 286 diff -u "$SCRIPTDIR/expected_deps_$TARGETARCH" actual || BAD_DIFF=1 |
| 281 if [ $BAD_DIFF -ne 0 ] && [ -z "${IGNORE_DEPS_CHANGES:-}" ]; then | 287 if [ $BAD_DIFF -ne 0 ] && [ -z "${IGNORE_DEPS_CHANGES:-}" ]; then |
| 282 echo | 288 echo |
| 283 echo "ERROR: Shared library dependencies changed!" | 289 echo "ERROR: Shared library dependencies changed!" |
| 284 echo "If this is intentional, please update:" | 290 echo "If this is intentional, please update:" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 334 # Only use the default REPOCONFIG if it's unset (e.g. verify_channel might have | 340 # Only use the default REPOCONFIG if it's unset (e.g. verify_channel might have |
| 335 # set it to an empty string) | 341 # set it to an empty string) |
| 336 REPOCONFIG="${REPOCONFIG-deb [arch=${ARCHITECTURE}] http://${BASEREPOCONFIG}}" | 342 REPOCONFIG="${REPOCONFIG-deb [arch=${ARCHITECTURE}] http://${BASEREPOCONFIG}}" |
| 337 # Allowed configs include optional HTTPS support and explicit multiarch | 343 # Allowed configs include optional HTTPS support and explicit multiarch |
| 338 # platforms. | 344 # platforms. |
| 339 REPOCONFIGREGEX="deb (\\\\[arch=[^]]*\\\\b${ARCHITECTURE}\\\\b[^]]*\\\\]" | 345 REPOCONFIGREGEX="deb (\\\\[arch=[^]]*\\\\b${ARCHITECTURE}\\\\b[^]]*\\\\]" |
| 340 REPOCONFIGREGEX+="[[:space:]]*) https?://${BASEREPOCONFIG}" | 346 REPOCONFIGREGEX+="[[:space:]]*) https?://${BASEREPOCONFIG}" |
| 341 stage_install_debian | 347 stage_install_debian |
| 342 | 348 |
| 343 do_package | 349 do_package |
| OLD | NEW |