index : asp32 | |
Archlinux32 fork of asp - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2017-03-25 08:59:38 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2017-03-25 09:18:50 -0400 |
commit | c2b33327aa7b8faf3c88aeaa007e7eb4bba4869f (patch) | |
tree | 15b46e42eb771e2c095e31ba7e27ee3fe6dcab02 /archweb.inc.sh | |
parent | f638242d6e81b72f8e0ea11a4f8c3c84099fd5b6 (diff) |
-rw-r--r-- | archweb.inc.sh | 9 |
diff --git a/archweb.inc.sh b/archweb.inc.sh new file mode 100644 index 0000000..b660c29 --- /dev/null +++ b/archweb.inc.sh @@ -0,0 +1,9 @@ +archweb_get_pkgbase() { + local pkgbase + + pkgbase=$(curl -s "https://www.archlinux.org/packages/search/json/?q=$1" | + jq -r --arg pkgname "$1" 'limit(1; .results[] | select(.pkgname == $pkgname).pkgbase)') + [[ $pkgbase ]] || return 1 + + printf '%s\n' "$pkgbase" +} |