diff options
author | XZS | 2015-10-15 01:25:12 +0200 |
---|---|---|
committer | XZS | 2015-10-15 01:25:12 +0200 |
commit | 7ef29f2970f4be84091813d4b8c048767451d19b (patch) | |
tree | 390879997ea7442de3cec7c54c0a64176df6ae4b | |
parent | 7e6f64f9a142705e1542c7e61fd5255f06480503 (diff) | |
download | aur-7ef29f2970f4be84091813d4b8c048767451d19b.tar.gz |
externalize compatible version query
This makes it easier to switch out the location this information is
retrieved from, should there be a more current source to query than the
install.rdf file included in the Add-On itself.
-rw-r--r-- | PKGBUILD | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -25,6 +25,18 @@ prepare() { find -name '.git*' -exec rm -rf '{}' + } +makedepends+=(rasqal) + +sparql() { + roqet -e "PREFIX em: <http://www.mozilla.org/2004/em-rdf#> SELECT ?x WHERE { $1 }" \ + -D "${2:-install.rdf}" -r csv 2>/dev/null | tr -d '\r' | tail -n 1 | head -c -1 +} + +# Retrieve current compatibility information from install.rdf. +query-version() { + sparql "[] em:id '$2' ; em:${1}Version ?x" install.rdf +} + pkgver() { cd "$_gitname" sed -n 's/.*"version"\s*:\s*"\([[:digit:].]*\)"\s*,.*/\1/p' \ @@ -54,13 +66,6 @@ for target in "${optdepends[@]}"; do done optdepends=() -makedepends+=(rasqal) - -sparql() { - roqet -e "PREFIX em: <http://www.mozilla.org/2004/em-rdf#> SELECT ?x WHERE { $1 }" \ - -D "${2:-install.rdf}" -r csv 2>/dev/null | tr -d '\r' | tail -n 1 | head -c -1 -} - version-range() { local emid=$(emid $1) echo "$1>$(version min $emid)" "$1<$(version max $emid)" @@ -75,9 +80,7 @@ emid() { } version() { - local version; - version=$(sparql "[] em:id '$2' ; em:${1}Version ?x" \ - "$srcdir/install.rdf" ) + local version="$(query-version $1 $2)" if [[ $version =~ ([[:digit:]]+).\* ]]; then if [[ $1 = max ]]; then echo $(( ${BASH_REMATCH[1]} + 1 )) |