Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: user_tools/linux/recovery.sh

Issue 5818002: Make curl follow redirections. wget already does. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 # 2 #
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS 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 # This attempts to guide linux users through the process of putting a recovery 7 # This attempts to guide linux users through the process of putting a recovery
8 # image onto a removeable USB drive. 8 # image onto a removeable USB drive.
9 # 9 #
10 # We may not need root privileges if we have the right permissions. 10 # We may not need root privileges if we have the right permissions.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 url="$1" 184 url="$1"
185 filename="$2" 185 filename="$2"
186 resume="${3:-}" 186 resume="${3:-}"
187 187
188 DEBUG "FETCH=($FETCH) url=($url) filename=($filename) resume=($resume)" 188 DEBUG "FETCH=($FETCH) url=($url) filename=($filename) resume=($resume)"
189 189
190 if [ "$FETCH" = "curl" ]; then 190 if [ "$FETCH" = "curl" ]; then
191 if [ -z "$resume" ]; then 191 if [ -z "$resume" ]; then
192 # quietly fetch a new copy each time 192 # quietly fetch a new copy each time
193 rm -f "$filename" 193 rm -f "$filename"
194 curl -f -s -S -o "$filename" "$url" 194 curl -L -f -s -S -o "$filename" "$url"
195 else 195 else
196 # continue where we left off, if possible 196 # continue where we left off, if possible
197 curl -f -C - -o "$filename" "$url" 197 curl -L -f -C - -o "$filename" "$url"
198 # If you give curl the '-C -' option but the file you want is already 198 # If you give curl the '-C -' option but the file you want is already
199 # complete and the server doesn't report the total size correctly, it 199 # complete and the server doesn't report the total size correctly, it
200 # will report an error instead of just doing nothing. We'll try to work 200 # will report an error instead of just doing nothing. We'll try to work
201 # around that. 201 # around that.
202 err=$? 202 err=$?
203 if [ "$err" = "18" ]; then 203 if [ "$err" = "18" ]; then
204 warn "Ignoring spurious complaint" 204 warn "Ignoring spurious complaint"
205 true 205 true
206 fi 206 fi
207 fi 207 fi
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 prompt "Shall I remove the temporary files now? [y/n] " 841 prompt "Shall I remove the temporary files now? [y/n] "
842 read tmp 842 read tmp
843 case $tmp in 843 case $tmp in
844 [Yy]*) 844 [Yy]*)
845 cd 845 cd
846 \rm -rf ${WORKDIR} 846 \rm -rf ${WORKDIR}
847 ;; 847 ;;
848 esac 848 esac
849 849
850 exit 0 850 exit 0
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698