@cryptotaxi247 / kubo / commits / dd007b236

misc: fix dist_get failing without failing

License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

Jakub Sztandera committed Mar 23, 2017 at 17:57 UTC dd007b236fcdc9209a2402b0d6739afebe1af249
1 file changed +6 -4
bin/dist_get
+6 -4
@@ -44,7 +44,7 @@ download() {
44 fi
45
46 try_download "$dl_url" "$dl_output" "wget '$dl_url' -O '$dl_output'" && return
47 - try_download "$dl_url" "$dl_output" "curl --silent '$dl_url' > '$dl_output'" && return
47 + try_download "$dl_url" "$dl_output" "curl --silent '$dl_url' > '$dl_output'" && return
48 try_download "$dl_url" "$dl_output" "fetch '$dl_url' -o '$dl_output'" && return
49 try_download "$dl_url" "$dl_output" "http '$dl_url' > '$dl_output'" && return
50
@@ -65,7 +65,8 @@ unarchive() {
65 tar.gz)
66 if have_binary tar; then
67 echo "==> using 'tar' to extract binary from archive"
68 - cat "$ua_infile" | tar -O -z -x -f - "$ua_distname/$ua_distname" > "$ua_outfile"
68 + < "$ua_infile" tar -Ozxf - "$ua_distname/$ua_distname" > "$ua_outfile" \
69 + || die "tar has failed"
70 else
71 die "no binary on system for extracting tar files"
72 fi
@@ -73,7 +74,8 @@ unarchive() {
74 zip)
75 if have_binary unzip; then
76 echo "==> using 'unzip' to extract binary from archive"
76 - unzip -p "$ua_infile" "$ua_distname/$ua_distname" > "$ua_outfile"
77 + unzip -p "$ua_infile" "$ua_distname/$ua_distname" > "$ua_outfile" \
78 + || die "unzip has failed"
79 else
80 die "no installed method for extracting .zip archives"
81 fi
@@ -82,7 +84,7 @@ unarchive() {
84 die "unrecognized archive type '$ua_archivetype'"
85 esac
86
85 - chmod +x "$ua_outfile"
87 + chmod +x "$ua_outfile" || die "chmod has failed"
88 }
89
90 get_go_vars() {