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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 PROVIDES="www-browser" | 106 PROVIDES="www-browser" |
107 gen_changelog | 107 gen_changelog |
108 process_template "${SCRIPTDIR}/control.template" "${DEB_CONTROL}" | 108 process_template "${SCRIPTDIR}/control.template" "${DEB_CONTROL}" |
109 export DEB_HOST_ARCH="${ARCHITECTURE}" | 109 export DEB_HOST_ARCH="${ARCHITECTURE}" |
110 if [ -f "${DEB_CONTROL}" ]; then | 110 if [ -f "${DEB_CONTROL}" ]; then |
111 gen_control | 111 gen_control |
112 fi | 112 fi |
113 fakeroot dpkg-deb -Zxz -z9 -b "${STAGEDIR}" . | 113 fakeroot dpkg-deb -Zxz -z9 -b "${STAGEDIR}" . |
114 } | 114 } |
115 | 115 |
116 verify_package() { | |
117 DEPENDS="${COMMON_DEPS}" # This needs to match do_package() above. | |
Tom Anderson
2017/05/26 23:56:16
Is DEPENDS just here for the comment? It's only u
Lei Zhang
2017/05/27 00:22:38
It's just here to help readers better understand w
| |
118 echo ${DEPENDS} | sed 's/, /\n/g' | LANG=C sort > expected_deb_depends | |
Tom Anderson
2017/05/26 23:56:15
Does this file get created in the out directory?
Lei Zhang
2017/05/27 00:22:38
Yes it does. Is that a problem? We do the same wit
Tom Anderson
2017/05/27 00:27:01
Ok good, just wanted to make sure it wasn't gettin
| |
119 dpkg -I "${PACKAGE}-${CHANNEL}_${VERSIONFULL}_${ARCHITECTURE}.deb" | \ | |
120 grep '^ Depends: ' | sed 's/^ Depends: //' | sed 's/, /\n/g' | \ | |
121 LANG=C sort > actual_deb_depends | |
122 BAD_DIFF=0 | |
123 diff -u expected_deb_depends actual_deb_depends || BAD_DIFF=1 | |
124 if [ $BAD_DIFF -ne 0 ] && [ -z "${IGNORE_DEPS_CHANGES:-}" ]; then | |
125 echo | |
126 echo "ERROR: bad dpkg dependencies!" | |
127 echo | |
128 exit $BAD_DIFF | |
129 fi | |
130 } | |
131 | |
116 # Remove temporary files and unwanted packaging output. | 132 # Remove temporary files and unwanted packaging output. |
117 cleanup() { | 133 cleanup() { |
118 echo "Cleaning..." | 134 echo "Cleaning..." |
119 rm -rf "${STAGEDIR}" | 135 rm -rf "${STAGEDIR}" |
120 rm -rf "${TMPFILEDIR}" | 136 rm -rf "${TMPFILEDIR}" |
121 } | 137 } |
122 | 138 |
123 usage() { | 139 usage() { |
124 echo "usage: $(basename $0) [-c channel] [-a target_arch] [-o 'dir'] " | 140 echo "usage: $(basename $0) [-c channel] [-a target_arch] [-o 'dir'] " |
125 echo " [-b 'dir'] -d branding" | 141 echo " [-b 'dir'] -d branding" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 echo | 314 echo |
299 exit $BAD_DIFF | 315 exit $BAD_DIFF |
300 fi | 316 fi |
301 | 317 |
302 # Additional dependencies not in the dpkg-shlibdeps output. | 318 # Additional dependencies not in the dpkg-shlibdeps output. |
303 # ca-certificates: Make sure users have SSL certificates. | 319 # ca-certificates: Make sure users have SSL certificates. |
304 # fonts-liberation: Make sure users have compatible fonts for viewing PDFs. | 320 # fonts-liberation: Make sure users have compatible fonts for viewing PDFs. |
305 # libappindicator1: Make systray icons work in Unity. | 321 # libappindicator1: Make systray icons work in Unity. |
306 # libnss3: Pull a more recent version of NSS than required by runtime linking, | 322 # libnss3: Pull a more recent version of NSS than required by runtime linking, |
307 # for security and stability updates in NSS. | 323 # for security and stability updates in NSS. |
308 # libstdc++6: For C++11 support. | |
Lei Zhang
2017/05/26 23:28:03
No longer needed. The expectation files already ha
| |
309 # lsb-release: For lsb_release. | 324 # lsb-release: For lsb_release. |
310 # xdg-utils: For OS integration. | 325 # xdg-utils: For OS integration. |
311 # wget: For uploading crash reports with Breakpad. | 326 # wget: For uploading crash reports with Breakpad. |
312 ADDITION_DEPS="ca-certificates, fonts-liberation, libappindicator1, \ | 327 ADDITIONAL_DEPS="ca-certificates, fonts-liberation, libappindicator1, \ |
313 libnss3 (>= 3.17.2), libstdc++6 (>=4.8.0), lsb-release, \ | 328 libnss3 (>= 3.17.2), lsb-release, xdg-utils (>= 1.0.2), wget" |
314 xdg-utils (>= 1.0.2), wget" | |
315 | 329 |
316 # Fix-up libnspr dependency due to renaming in Ubuntu (the old package still | 330 # Fix-up libnspr dependency due to renaming in Ubuntu (the old package still |
317 # exists, but it was moved to "universe" repository, which isn't installed by | 331 # exists, but it was moved to "universe" repository, which isn't installed by |
318 # default). | 332 # default). |
333 # TODO(thestig): This is probably no longer needed. Verify and remove. | |
319 DPKG_SHLIB_DEPS=$(sed \ | 334 DPKG_SHLIB_DEPS=$(sed \ |
320 's/\(libnspr4-0d ([^)]*)\), /\1 | libnspr4 (>= 4.9.5-0ubuntu0), /g' \ | 335 's/\(libnspr4-0d ([^)]*)\), /\1 | libnspr4 (>= 4.9.5-0ubuntu0), /g' \ |
321 <<< $DPKG_SHLIB_DEPS) | 336 <<< $DPKG_SHLIB_DEPS) |
322 | 337 |
323 COMMON_DEPS="${DPKG_SHLIB_DEPS}, ${ADDITION_DEPS}" | 338 # Remove libnss dependency so the one in $ADDITIONAL_DEPS can supercede it. |
339 DPKG_SHLIB_DEPS=$(sed 's/\(libnss3 ([^)]*)\), //g' <<< $DPKG_SHLIB_DEPS) | |
340 | |
341 COMMON_DEPS="${DPKG_SHLIB_DEPS}, ${ADDITIONAL_DEPS}" | |
324 COMMON_PREDEPS="dpkg (>= 1.14.0)" | 342 COMMON_PREDEPS="dpkg (>= 1.14.0)" |
325 | 343 |
326 | 344 |
327 # Make everything happen in the OUTPUTDIR. | 345 # Make everything happen in the OUTPUTDIR. |
328 cd "${OUTPUTDIR}" | 346 cd "${OUTPUTDIR}" |
329 | 347 |
330 case "$TARGETARCH" in | 348 case "$TARGETARCH" in |
331 ia32 ) | 349 ia32 ) |
332 export ARCHITECTURE="i386" | 350 export ARCHITECTURE="i386" |
333 ;; | 351 ;; |
(...skipping 11 matching lines...) Expand all Loading... | |
345 # Only use the default REPOCONFIG if it's unset (e.g. verify_channel might have | 363 # Only use the default REPOCONFIG if it's unset (e.g. verify_channel might have |
346 # set it to an empty string) | 364 # set it to an empty string) |
347 REPOCONFIG="${REPOCONFIG-deb [arch=${ARCHITECTURE}] http://${BASEREPOCONFIG}}" | 365 REPOCONFIG="${REPOCONFIG-deb [arch=${ARCHITECTURE}] http://${BASEREPOCONFIG}}" |
348 # Allowed configs include optional HTTPS support and explicit multiarch | 366 # Allowed configs include optional HTTPS support and explicit multiarch |
349 # platforms. | 367 # platforms. |
350 REPOCONFIGREGEX="deb (\\\\[arch=[^]]*\\\\b${ARCHITECTURE}\\\\b[^]]*\\\\]" | 368 REPOCONFIGREGEX="deb (\\\\[arch=[^]]*\\\\b${ARCHITECTURE}\\\\b[^]]*\\\\]" |
351 REPOCONFIGREGEX+="[[:space:]]*) https?://${BASEREPOCONFIG}" | 369 REPOCONFIGREGEX+="[[:space:]]*) https?://${BASEREPOCONFIG}" |
352 stage_install_debian | 370 stage_install_debian |
353 | 371 |
354 do_package | 372 do_package |
373 verify_package | |
OLD | NEW |