diff options
author | XZS | 2015-10-15 01:25:44 +0200 |
---|---|---|
committer | XZS | 2015-10-15 01:25:44 +0200 |
commit | f8e47373e63bedd0904059488e12fd2f83a7f9e5 (patch) | |
tree | 269b7ef2acfae5d353fb08c39c3530f98ac94cd5 | |
parent | c078753bd402c0010772c8fbbaea9d4e6c61ffad (diff) | |
download | aur-f8e47373e63bedd0904059488e12fd2f83a7f9e5.tar.gz |
ask addons.mozilla.org for updated information
The addons.mozilla.org API provides updated information about Add-On
compatibility more recent than the install.rdf file included in the
extension. Restricting package relations according to it yields a wider
version range, especially with newer versions.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 15 |
2 files changed, 13 insertions, 4 deletions
@@ -8,7 +8,9 @@ pkgbase = firefox-theme-nasa-night-launch makedepends = rasqal depends = firefox source = firefox-theme-nasa-night-launch.zip::https://addons.mozilla.org/firefox/downloads/latest/nasa-night-launch/platform:2/ + source = version::https://services.addons.mozilla.org/en-US/firefox/api/1.5/addon/nasa-night-launch md5sums = 865000b40b8e5924117368837d2f9ce1 + md5sums = SKIP pkgname = firefox-theme-nasa-night-launch @@ -13,7 +13,11 @@ md5sums=('865000b40b8e5924117368837d2f9ce1') [ "$arch" ] || arch=('any') -source+=("${pkgname}.zip::https://addons.mozilla.org/firefox/downloads/latest/${pkgname#*-*-}/platform:2/") +source+=( + "${pkgname}.zip::https://addons.mozilla.org/firefox/downloads/latest/${pkgname#*-*-}/platform:2/" + "version::https://services.addons.mozilla.org/en-US/firefox/api/1.5/addon/${pkgname#*-*-}" +) +md5sums+=('SKIP') prepare() { rm ${pkgname}.zip @@ -30,6 +34,11 @@ pkgver() { sparql '<urn:mozilla:install-manifest> em:version ?x' | tr - . } +# Retrieve current compatibility information from addons.mozilla.org API. +query-version() { + xmllint version --xpath \ + "//application[appID='$2']/$1_version/text()" +} version-range() { local emid=$(emid $1) echo "$1>$(version min $emid)" "$1<$(version max $emid)" @@ -44,9 +53,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 )) |