index : asp32 | |
Archlinux32 fork of asp - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2019-02-12 07:12:49 -0500 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2019-02-12 07:12:49 -0500 |
commit | 4d4e4ab07e2c6fb64a84727ca21dba6066598878 (patch) | |
tree | 4f6150767a8a76b817626e5b611a4b729ed6eaae | |
parent | fe50aec47abf45175d01a620e81dc32f35f74fe0 (diff) |
-rw-r--r-- | archweb.inc.sh | 9 |
diff --git a/archweb.inc.sh b/archweb.inc.sh index 6075c41..fd88c59 100644 --- a/archweb.inc.sh +++ b/archweb.inc.sh @@ -1,4 +1,9 @@ archweb_get_pkgbase() { - curl -Gs "https://www.archlinux.org/packages/search/json/" --data-urlencode "q=$1" | - jq -er --arg pkgname "$1" 'limit(1; .results[] | select(.pkgname == $pkgname).pkgbase)' + local pkgbase + + pkgbase=$(curl -Gs 'https://www.archlinux.org/packages/search/json/' --data-urlencode "q=$1" | + jq -r --arg pkgname "$1" 'limit(1; .results[] | select(.pkgname == $pkgname).pkgbase)') + [[ $pkgbase ]] || return + + printf '%s\n' "$pkgbase" } |