OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 # | 4 # |
5 # This script should not be run directly but sourced by the other | 5 # This script should not be run directly but sourced by the other |
6 # scripts (e.g. sysroot-creator-trusty.sh). Its up to the parent scripts | 6 # scripts (e.g. sysroot-creator-jessie.sh). Its up to the parent scripts |
7 # to define certain environment variables: e.g. | 7 # to define certain environment variables: e.g. |
8 # DISTRO=ubuntu | 8 # DISTRO=ubuntu |
9 # DIST=trusty | 9 # DIST=jessie |
10 # DIST_UPDATES=trusty-updates # optional | 10 # DIST_UPDATES=jessie-updates # optional |
11 # REPO_EXTRA="universe restricted multiverse" # optional | 11 # REPO_EXTRA="universe restricted multiverse" # optional |
12 # APT_REPO=http://archive.ubuntu.com/ubuntu | 12 # APT_REPO=http://archive.ubuntu.com/ubuntu |
13 # KEYRING_FILE=/usr/share/keyrings/ubuntu-archive-keyring.gpg | 13 # KEYRING_FILE=/usr/share/keyrings/ubuntu-archive-keyring.gpg |
14 # DEBIAN_PACKAGES="gcc libz libssl" | 14 # DEBIAN_PACKAGES="gcc libz libssl" |
15 | 15 |
16 #@ This script builds Debian/Ubuntu sysroot images for building Google Chrome. | 16 #@ This script builds Debian/Ubuntu sysroot images for building Google Chrome. |
17 #@ | 17 #@ |
18 #@ Generally this script is invoked as: | 18 #@ Generally this script is invoked as: |
19 #@ sysroot-creator-<flavour>.sh <mode> <args>* | 19 #@ sysroot-creator-<flavour>.sh <mode> <args>* |
20 #@ Available modes are shown below. | 20 #@ Available modes are shown below. |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 #@ PrintDistro | 843 #@ PrintDistro |
844 #@ | 844 #@ |
845 #@ Prints distro. eg: ubuntu | 845 #@ Prints distro. eg: ubuntu |
846 PrintDistro() { | 846 PrintDistro() { |
847 echo ${DISTRO} | 847 echo ${DISTRO} |
848 } | 848 } |
849 | 849 |
850 #@ | 850 #@ |
851 #@ DumpRelease | 851 #@ DumpRelease |
852 #@ | 852 #@ |
853 #@ Prints disto release. eg: trusty | 853 #@ Prints disto release. eg: jessie |
854 PrintRelease() { | 854 PrintRelease() { |
855 echo ${DIST} | 855 echo ${DIST} |
856 } | 856 } |
857 | 857 |
858 RunCommand() { | 858 RunCommand() { |
859 SetEnvironmentVariables "$1" | 859 SetEnvironmentVariables "$1" |
860 SanityCheck | 860 SanityCheck |
861 "$@" | 861 "$@" |
862 } | 862 } |
863 | 863 |
864 if [ $# -eq 0 ] ; then | 864 if [ $# -eq 0 ] ; then |
865 echo "ERROR: you must specify a mode on the commandline" | 865 echo "ERROR: you must specify a mode on the commandline" |
866 echo | 866 echo |
867 Usage | 867 Usage |
868 exit 1 | 868 exit 1 |
869 elif [ "$(type -t $1)" != "function" ]; then | 869 elif [ "$(type -t $1)" != "function" ]; then |
870 echo "ERROR: unknown function '$1'." >&2 | 870 echo "ERROR: unknown function '$1'." >&2 |
871 echo "For help, try:" | 871 echo "For help, try:" |
872 echo " $0 help" | 872 echo " $0 help" |
873 exit 1 | 873 exit 1 |
874 else | 874 else |
875 ChangeDirectory | 875 ChangeDirectory |
876 if echo $1 | grep -qs --regexp='\(^Print\)\|\(All$\)'; then | 876 if echo $1 | grep -qs --regexp='\(^Print\)\|\(All$\)'; then |
877 "$@" | 877 "$@" |
878 else | 878 else |
879 RunCommand "$@" | 879 RunCommand "$@" |
880 fi | 880 fi |
881 fi | 881 fi |
OLD | NEW |