summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorXZS2015-10-15 01:26:47 +0200
committerXZS2015-10-15 01:26:47 +0200
commit36fbcb6056cc59819fe177acc07a7af5691347aa (patch)
treed7b86781ea2a1c70c492f6421c7def436dc9d71d
parent1a341502c84c7e415cf29d0874b8b92fae496938 (diff)
downloadaur-36fbcb6056cc59819fe177acc07a7af5691347aa.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--PKGBUILD11
1 files changed, 7 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index c8a042a02afc..f24640f3e1cf 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -32,13 +32,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)"
@@ -53,9 +58,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 ))