Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archweb.inc.sh
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-17 21:22:32 +0100
committerErich Eckner <git@eckner.net>2019-02-17 21:22:32 +0100
commitefddf4557c5463249f20ff4812f4dbdfb0e1b33a (patch)
tree9465d376c05197c555a03af62bfa004cfd8f089f /archweb.inc.sh
parent22e0963aaab28358c4ebd6db6c9b23e881a995cf (diff)
parent4d4e4ab07e2c6fb64a84727ca21dba6066598878 (diff)
Merge remote-tracking branch 'upstream/master'next
Diffstat (limited to 'archweb.inc.sh')
-rw-r--r--archweb.inc.sh9
1 files changed, 7 insertions, 2 deletions
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"
}