OLD | NEW |
1 #!/bin/bash -e | 1 #!/bin/bash -e |
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 # Script to install everything needed to build chromium (well, ideally, anyway) | 7 # Script to install everything needed to build chromium (well, ideally, anyway) |
8 # See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_i
nstructions.md | 8 # See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_i
nstructions.md |
9 | 9 |
10 usage() { | 10 usage() { |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 fi | 365 fi |
366 | 366 |
367 # The `sort -r -s -t: -k2` sorts all the :i386 packages to the front, to avoid | 367 # The `sort -r -s -t: -k2` sorts all the :i386 packages to the front, to avoid |
368 # confusing dpkg-query (crbug.com/446172). | 368 # confusing dpkg-query (crbug.com/446172). |
369 packages="$( | 369 packages="$( |
370 echo "${dev_list} ${lib_list} ${dbg_list} ${lib32_list} ${arm_list}"\ | 370 echo "${dev_list} ${lib_list} ${dbg_list} ${lib32_list} ${arm_list}"\ |
371 "${nacl_list}" | tr " " "\n" | sort -u | sort -r -s -t: -k2 | tr "\n" " " | 371 "${nacl_list}" | tr " " "\n" | sort -u | sort -r -s -t: -k2 | tr "\n" " " |
372 )" | 372 )" |
373 | 373 |
374 if [ 1 -eq "${do_quick_check-0}" ] ; then | 374 if [ 1 -eq "${do_quick_check-0}" ] ; then |
375 failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \ | 375 if ! missing_packages="$(dpkg-query -W -f ' ' ${packages} 2>&1)"; then |
376 ${packages} 2>&1 | grep -v "ok installed" || :)" | 376 # Distinguish between packages that actually aren't available to the |
377 if [ -n "${failed_check}" ]; then | 377 # system (i.e. not in any repo) and packages that just aren't known to |
378 echo | 378 # dpkg (i.e. managed by apt). |
379 nomatch="$(echo "${failed_check}" | \ | 379 missing_packages="$(echo "${missing_packages}" | awk '{print $NF}')" |
380 sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")" | 380 not_installed="" |
381 missing="$(echo "${failed_check}" | \ | 381 unknown="" |
382 sed -e "/^No packages found matching/d;s/^\(.*\):.*$/\1/")" | 382 for p in ${missing_packages}; do |
383 if [ "$nomatch" ]; then | 383 if apt-cache show ${p} > /dev/null 2>&1; then |
384 # Distinguish between packages that actually aren't available to the | 384 not_installed="${p}\n${not_installed}" |
385 # system (i.e. not in any repo) and packages that just aren't known to | 385 else |
386 # dpkg (i.e. managed by apt). | 386 unknown="${p}\n${unknown}" |
387 unknown="" | |
388 for p in ${nomatch}; do | |
389 if apt-cache show ${p} > /dev/null 2>&1; then | |
390 missing="${p}\n${missing}" | |
391 else | |
392 unknown="${p}\n${unknown}" | |
393 fi | |
394 done | |
395 if [ -n "${unknown}" ]; then | |
396 echo "WARNING: The following packages are unknown to your system" | |
397 echo "(maybe missing a repo or need to 'sudo apt-get update'):" | |
398 echo -e "${unknown}" | sed -e "s/^/ /" | |
399 fi | 387 fi |
| 388 done |
| 389 if [ -n "${not_installed}" ]; then |
| 390 echo "WARNING: The following packages are not installed:" |
| 391 echo -e "${not_installed}" | sed -e "s/^/ /" |
400 fi | 392 fi |
401 if [ -n "${missing}" ]; then | 393 if [ -n "${unknown}" ]; then |
402 echo "WARNING: The following packages are not installed:" | 394 echo "WARNING: The following packages are unknown to your system" |
403 echo -e "${missing}" | sed -e "s/^/ /" | 395 echo "(maybe missing a repo or need to 'sudo apt-get update'):" |
| 396 echo -e "${unknown}" | sed -e "s/^/ /" |
404 fi | 397 fi |
405 exit 1 | 398 exit 1 |
406 fi | 399 fi |
407 exit 0 | 400 exit 0 |
408 fi | 401 fi |
409 | 402 |
410 if test "$do_inst_lib32" = "1" || test "$do_inst_nacl" = "1"; then | 403 if test "$do_inst_lib32" = "1" || test "$do_inst_nacl" = "1"; then |
411 if [[ ! $lsb_release =~ (precise) ]]; then | 404 if [[ ! $lsb_release =~ (precise) ]]; then |
412 sudo dpkg --add-architecture i386 | 405 sudo dpkg --add-architecture i386 |
413 fi | 406 fi |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 # only contains libcrypto.so.1.0.0 and not the symlink needed for | 491 # only contains libcrypto.so.1.0.0 and not the symlink needed for |
499 # linking (libcrypto.so). | 492 # linking (libcrypto.so). |
500 create_library_symlink /lib/i386-linux-gnu/libcrypto.so.1.0.0 \ | 493 create_library_symlink /lib/i386-linux-gnu/libcrypto.so.1.0.0 \ |
501 /usr/lib/i386-linux-gnu/libcrypto.so | 494 /usr/lib/i386-linux-gnu/libcrypto.so |
502 | 495 |
503 create_library_symlink /lib/i386-linux-gnu/libssl.so.1.0.0 \ | 496 create_library_symlink /lib/i386-linux-gnu/libssl.so.1.0.0 \ |
504 /usr/lib/i386-linux-gnu/libssl.so | 497 /usr/lib/i386-linux-gnu/libssl.so |
505 else | 498 else |
506 echo "Skipping symbolic links for NaCl." | 499 echo "Skipping symbolic links for NaCl." |
507 fi | 500 fi |
OLD | NEW |