OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # Copyright 2014 Google Inc. | 3 # Copyright 2014 Google Inc. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 | 8 |
9 usage() { | 9 usage() { |
10 cat >&2 <<EOF | 10 cat >&2 <<EOF |
(...skipping 27 matching lines...) Expand all Loading... |
38 if [ $ret != 0 ] ; then | 38 if [ $ret != 0 ] ; then |
39 echo "'$@' failed and returned ${ret}." >&2 | 39 echo "'$@' failed and returned ${ret}." >&2 |
40 return $ret | 40 return $ret |
41 fi | 41 fi |
42 } | 42 } |
43 | 43 |
44 gsutil_check_get() { | 44 gsutil_check_get() { |
45 local gurl="$1" | 45 local gurl="$1" |
46 local file="$2" | 46 local file="$2" |
47 if ! [ -f "$file" ] || \ | 47 if ! [ -f "$file" ] || \ |
48 [ "$(gsutil stat "$gurl" | sed -n 's/\W*Hash (md5):\W*//p')" \ | 48 [ "$(gsutil ls -L "$gurl" | sed -n 's/\W*Hash (md5):\W*//p')" \ |
49 != "$(md5sum < "$file" | sed 's/\W*-//')" ] ; then | 49 != "$(md5sum < "$file" | sed 's/\W*-//')" ] ; then |
50 try gsutil cp "$gurl" "$file" || return | 50 try gsutil cp "$gurl" "$file" || return |
51 fi | 51 fi |
52 } | 52 } |
53 | 53 |
54 download_compiler() { | 54 download_compiler() { |
55 local working_dir="$1" | 55 local working_dir="$1" |
56 local location="$2" | 56 local location="$2" |
57 local toolchain="$3" | 57 local toolchain="$3" |
58 | 58 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 158 } |
159 | 159 |
160 for command in gsutil xz tar gunzip; do | 160 for command in gsutil xz tar gunzip; do |
161 try command -v "$command" > /dev/null || usage || exit | 161 try command -v "$command" > /dev/null || usage || exit |
162 done | 162 done |
163 | 163 |
164 if [ -z "$1" ] ; then | 164 if [ -z "$1" ] ; then |
165 usage || exit | 165 usage || exit |
166 fi | 166 fi |
167 try arm64_download "$1" || exit | 167 try arm64_download "$1" || exit |
OLD | NEW |