summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korotkiy2019-06-19 02:47:52 +0300
committerNikolay Korotkiy2019-06-19 02:47:52 +0300
commited028975cc55083679fa1d591008d029226221a4 (patch)
tree9019a275788ff9bdbcf517aad5884f51838089b8
parentb1663616f4490c0ddbfdb1c598fe89bbe70d8b1d (diff)
downloadaur-ed028975cc55083679fa1d591008d029226221a4.tar.gz
Fix pkgver()
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD43
2 files changed, 24 insertions, 29 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9099e014d8ed..ec376743f35b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,19 +1,19 @@
# Generated by makepkg 5.1.3
-# Sat Jun 15 21:59:32 UTC 2019
+# Tue Jun 18 23:43:29 UTC 2019
pkgbase = gpxsee-git
pkgdesc = GPS log file viewer and analyzer
- pkgver = 7.9.r1676.811f5f86
- pkgrel = 1
+ pkgver = 7.9.r0.g811f5f8
+ pkgrel = 2
url = https://www.gpxsee.org/
arch = i686
arch = x86_64
license = GPL3
makedepends = qt5-tools
- makedepends = python
+ makedepends = jq
depends = qt5-base
optdepends = qt5-imageformats: Support for GeoTIFF images
optdepends = qt5-pbfimageplugin: Support for PBF vector maps
- provides = gpxsee=7.9.r1676.811f5f86
+ provides = gpxsee=7.9.r0.g811f5f8
conflicts = gpxsee
source = https://github.com/tumic0/GPXSee/archive/master.tar.gz
sha256sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index 31b0dd213473..375b964ea2df 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,12 +5,13 @@ _orgname=tumic0
_pkgname=GPXSee
_branch=master
_use_gh_api=true
-wl_project=${_pkgname}
-wl_hz="https://hosted.weblate.org/healthz/"
-wl_dl="https://hosted.weblate.org/download/${wl_project}"
+_gh_api_url="https://api.github.com/repos/${_orgname}/${_pkgname}"
+_wl_project=${_pkgname}
+_wl_hz="https://hosted.weblate.org/healthz/"
+_wl_dl="https://hosted.weblate.org/download/${_wl_project}"
pkgname=${_pkgname,,}-git
-pkgver=7.9.r1676.811f5f86
-pkgrel=1
+pkgver=7.9.r0.g811f5f8
+pkgrel=2
pkgdesc='GPS log file viewer and analyzer'
arch=('i686' 'x86_64')
url='https://www.gpxsee.org/'
@@ -18,7 +19,7 @@ license=('GPL3')
depends=('qt5-base')
makedepends=('qt5-tools')
if [ "${_use_gh_api}" = true ]; then
- makedepends+=('python')
+ makedepends+=('jq')
else
makedepends+=('git')
fi
@@ -34,31 +35,25 @@ fi
sha256sums=('SKIP')
pkgver() {
- cd ${_pkgname}-${_branch}
-
if [ "${_use_gh_api}" = true ]; then
- api_url="https://api.github.com/repos/${_orgname}/${_pkgname}"
- base='928e259d'
- head=$(curl -s "${api_url}/git/refs/heads/${_branch}" | \
- python -c "import sys, json; print(json.load(sys.stdin)['object']['sha'][:8])")
- count=$(curl -s "${api_url}/compare/${base}...${head}" | \
- python -c "import sys, json; print(json.load(sys.stdin)['total_commits'] + 1)")
- release=$(curl -s "${api_url}/tags" | \
- python -c "import sys, json; r = json.load(sys.stdin)[0]; print(r['name'])")
+ read -r tag_name tag_sha <<<$(curl -s "${_gh_api_url}/tags" | \
+ jq -r '.[0]|[.name,.commit.sha]|@sh' | sed "s/'//g")
+ head=$(curl -s "${_gh_api_url}/git/refs/heads/${_branch}" | \
+ jq -r '.object.sha')
+ count=$(curl -s "${_gh_api_url}/compare/${tag_sha}...${head}" | \
+ jq -r '.total_commits')
+
+ printf "%s.r%s.g%.7s" "${tag_name}" "${count}" "${head}"
else
- release="$(git describe --tags $(git rev-list --tags --max-count=1))"
- count="$(git rev-list --count HEAD)"
- head="$(git rev-parse --short HEAD)"
+ cd ${_pkgname}-${_branch}
+ git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
fi
-
- release=${release//-/.} # pkgver is not allowed to contain hyphens
- printf "%s.r%s.%s" "${release}" "${count}" "${head}"
}
wl_update() {
find . -name "${2}*.ts" -a ! -name "*_en.ts" | \
xargs basename -s .ts | \
- xargs -P 0 -I{} sh -c "curl -so \$1.ts $wl_dl/${1}/\${1#${2}}/" -- {}
+ xargs -P 0 -I{} sh -c "curl -so \$1.ts ${_wl_dl}/${1}/\${1#${2}}/" -- {}
}
prepare() {
@@ -66,7 +61,7 @@ prepare() {
sed -i "s/\(VERSION = \).*/\1${pkgver}/" gpxsee.pro
- if [ "`curl $wl_hz`" = "ok" ]; then
+ if [ "`curl ${_wl_hz}`" = "ok" ]; then
cd lang
rename nb nb_NO *_nb.ts
wl_update Translations ${_pkgname,,}_