summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 19:36:02 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 19:44:27 -0600
commit8449ab5e3a57c96ea8a7f88e45cac030be5fe377 (patch)
tree67fd7ff9bf7ecad27ec7ff349accf4140b738e72
parentc073f8720161930ecd3f80174b93aa62b63834a4 (diff)
aur: play with return status
-rwxr-xr-xsrc/aur8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/aur b/src/aur
index 6e7cd99..8ef20cf 100755
--- a/src/aur
+++ b/src/aur
@@ -48,6 +48,7 @@ main() {
check_vars libretools DIFFTOOL
local missing_deps=()
+ local ret=0
for _pkg in "$@"; do
# Remove the version
@@ -64,10 +65,13 @@ main() {
msg "Downloading $_pkg..."
local url=https://aur.archlinux.org/packages/${_pkg:0:2}/${_pkg}/$_pkg.tar.gz
- if ! wget -O - -q "$url" | tar xzf - >&2; then
+ set -o pipefail
+ if ! wget -O- "$url" | bsdtar xf -; then
+ ret=$(($ret|2))
error "Couldn't get $_pkg"
continue
fi
+ set +o pipefail
pushd $_pkg &>/dev/null
@@ -135,7 +139,9 @@ main() {
if [[ ${#missing_deps[*]} -gt 0 ]]; then
msg2 "Retrieving missing deps: %s" "${missing_deps[*]}"
"$0" "${missing_deps[@]}"
+ ret=$(($ret|2))
fi
+ return $ret;
}
main "$@"