summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorXZS2015-10-15 01:25:36 +0200
committerXZS2015-10-15 01:25:36 +0200
commit27d35df37c7d98fdab3413afdc32c42a7c008942 (patch)
treeaa090749c618902bb4da75327cd6d103098e3fd7
parent24f96495541066a3e086a6fdc82f17a6996cdbb5 (diff)
downloadaur-27d35df37c7d98fdab3413afdc32c42a7c008942.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 a6ebd8e9225..8d3697e6790 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -37,6 +37,12 @@ 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 - .
@@ -66,7 +72,6 @@ for target in "${optdepends[@]}"; do
done
optdepends=()
-
version-range() {
local emid=$(emid $1)
echo "$1>$(version min $emid)" "$1<$(version max $emid)"
@@ -81,9 +86,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 ))