diff options
author | XZS | 2015-10-15 01:26:13 +0200 |
---|---|---|
committer | XZS | 2015-10-15 01:26:13 +0200 |
commit | 48e9b8f93a71724eaec135206112621b1a73d71f (patch) | |
tree | 5431059ebc52837a2a04d613a7cbaf0e15424612 | |
parent | ea597d0bfaf440044d59f0cefdd550e107259342 (diff) | |
download | aur-48e9b8f93a71724eaec135206112621b1a73d71f.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 | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -31,13 +31,18 @@ sparql() { -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 sparql '<urn:mozilla:install-manifest> em:version ?x' | tr - . echo -n . printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } - version-range() { local emid=$(emid $1) echo "$1>$(version min $emid)" "$1<$(version max $emid)" @@ -52,9 +57,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 )) |