| 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-jessie.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=jessie | 9 # DIST=jessie |
| 10 # # Similar in syntax to /etc/apt/sources.list | 10 # # Similar in syntax to /etc/apt/sources.list |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 for tool in ${REQUIRED_TOOLS} ; do | 148 for tool in ${REQUIRED_TOOLS} ; do |
| 149 if ! which ${tool} > /dev/null ; then | 149 if ! which ${tool} > /dev/null ; then |
| 150 echo "Required binary $tool not found." | 150 echo "Required binary $tool not found." |
| 151 echo "Exiting." | 151 echo "Exiting." |
| 152 exit 1 | 152 exit 1 |
| 153 fi | 153 fi |
| 154 done | 154 done |
| 155 | 155 |
| 156 # This is where the staging sysroot is. | 156 # This is where the staging sysroot is. |
| 157 INSTALL_ROOT="${BUILD_DIR}/${DIST}_${ARCH_LOWER}_staging" | 157 INSTALL_ROOT="${BUILD_DIR}/${DIST}_${ARCH_LOWER}_staging" |
| 158 TARBALL="${BUILD_DIR}/${DISTRO}_${DIST}_${ARCH_LOWER}_sysroot.tgz" | 158 TARBALL="${BUILD_DIR}/${DISTRO}_${DIST}_${ARCH_LOWER}_sysroot.tar.xz" |
| 159 | 159 |
| 160 if ! mkdir -p "${INSTALL_ROOT}" ; then | 160 if ! mkdir -p "${INSTALL_ROOT}" ; then |
| 161 echo "ERROR: ${INSTALL_ROOT} can't be created." | 161 echo "ERROR: ${INSTALL_ROOT} can't be created." |
| 162 exit 1 | 162 exit 1 |
| 163 fi | 163 fi |
| 164 } | 164 } |
| 165 | 165 |
| 166 | 166 |
| 167 ChangeDirectory() { | 167 ChangeDirectory() { |
| 168 # Change directory to where this script is. | 168 # Change directory to where this script is. |
| 169 cd ${SCRIPT_DIR} | 169 cd ${SCRIPT_DIR} |
| 170 } | 170 } |
| 171 | 171 |
| 172 | 172 |
| 173 ClearInstallDir() { | 173 ClearInstallDir() { |
| 174 Banner "Clearing dirs in ${INSTALL_ROOT}" | 174 Banner "Clearing dirs in ${INSTALL_ROOT}" |
| 175 rm -rf ${INSTALL_ROOT}/* | 175 rm -rf ${INSTALL_ROOT}/* |
| 176 } | 176 } |
| 177 | 177 |
| 178 | 178 |
| 179 CreateTarBall() { | 179 CreateTarBall() { |
| 180 Banner "Creating tarball ${TARBALL}" | 180 Banner "Creating tarball ${TARBALL}" |
| 181 tar zcf ${TARBALL} -C ${INSTALL_ROOT} . | 181 tar Jcf ${TARBALL} -C ${INSTALL_ROOT} . |
| 182 } | 182 } |
| 183 | 183 |
| 184 ExtractPackageGz() { | 184 ExtractPackageGz() { |
| 185 local src_file="$1" | 185 local src_file="$1" |
| 186 local dst_file="$2" | 186 local dst_file="$2" |
| 187 local repo="$3" | 187 local repo="$3" |
| 188 gunzip -c "${src_file}" | egrep '^(Package:|Filename:|SHA256:) ' | | 188 gunzip -c "${src_file}" | egrep '^(Package:|Filename:|SHA256:) ' | |
| 189 sed "s|Filename: |Filename: ${repo}|" > "${dst_file}" | 189 sed "s|Filename: |Filename: ${repo}|" > "${dst_file}" |
| 190 } | 190 } |
| 191 | 191 |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 echo " $0 help" | 862 echo " $0 help" |
| 863 exit 1 | 863 exit 1 |
| 864 else | 864 else |
| 865 ChangeDirectory | 865 ChangeDirectory |
| 866 if echo $1 | grep -qs --regexp='\(^Print\)\|\(All$\)'; then | 866 if echo $1 | grep -qs --regexp='\(^Print\)\|\(All$\)'; then |
| 867 "$@" | 867 "$@" |
| 868 else | 868 else |
| 869 RunCommand "$@" | 869 RunCommand "$@" |
| 870 fi | 870 fi |
| 871 fi | 871 fi |
| OLD | NEW |