Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: fix dist_get failing without failing #3818

Merged
merged 1 commit into from
Mar 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions bin/dist_get
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ download() {
fi

try_download "$dl_url" "$dl_output" "wget '$dl_url' -O '$dl_output'" && return
try_download "$dl_url" "$dl_output" "curl --silent '$dl_url' > '$dl_output'" && return
try_download "$dl_url" "$dl_output" "curl --silent '$dl_url' > '$dl_output'" && return
try_download "$dl_url" "$dl_output" "fetch '$dl_url' -o '$dl_output'" && return
try_download "$dl_url" "$dl_output" "http '$dl_url' > '$dl_output'" && return

Expand All @@ -65,15 +65,17 @@ unarchive() {
tar.gz)
if have_binary tar; then
echo "==> using 'tar' to extract binary from archive"
cat "$ua_infile" | tar -O -z -x -f - "$ua_distname/$ua_distname" > "$ua_outfile"
< "$ua_infile" tar -Ozxf - "$ua_distname/$ua_distname" > "$ua_outfile" \
|| die "tar has failed"
else
die "no binary on system for extracting tar files"
fi
;;
zip)
if have_binary unzip; then
echo "==> using 'unzip' to extract binary from archive"
unzip -p "$ua_infile" "$ua_distname/$ua_distname" > "$ua_outfile"
unzip -p "$ua_infile" "$ua_distname/$ua_distname" > "$ua_outfile" \
|| die "unzip has failed"
else
die "no installed method for extracting .zip archives"
fi
Expand All @@ -82,7 +84,7 @@ unarchive() {
die "unrecognized archive type '$ua_archivetype'"
esac

chmod +x "$ua_outfile"
chmod +x "$ua_outfile" || die "chmod has failed"
}

get_go_vars() {
Expand Down