diff options
author | Mikael Blomstrand | 2020-10-28 12:33:11 +0100 |
---|---|---|
committer | Mikael Blomstrand | 2020-10-28 14:34:08 +0100 |
commit | 93a1dd264ea5f596e23051e5ff26170d59728bd2 (patch) | |
tree | 054ce134803b87f11a8484313186e99dea40969a /PKGBUILD | |
parent | c5e1df80c5e654727ec82457b0b296a81d9a242e (diff) | |
download | aur-futhark-nightly.tar.gz |
pkgver(): fall back on timestamp if not git describe in commit-id
Revert "commit-id now contains output from `git describe`!"
This reverts commit c5e1df80c5e654727ec82457b0b296a81d9a242e.
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -2,7 +2,7 @@ # Contributor: Olaf Leidinger <oleid@mescharet.de> pkgname=futhark-nightly -pkgver=0.15.5.r5.gf59a43a58 +pkgver=0.19.0.r1603790886.g0d10f768 pkgrel=1 pkgdesc="A data-parallel functional programming language" arch=('x86_64') @@ -14,16 +14,25 @@ depends=('ncurses5-compat-libs' optdepends=('opencl-headers: opencl support' 'ocl-icd: opencl support' 'opencl-driver: opencl support') -makedepends=() +makedepends=('curl') provides=("${pkgname%-nightly}") conflicts=("${pkgname%-nightly}") -_timestamp=$(date -u +%Y%m%d%H) -source=("${pkgname}-${_timestamp}.tar.xz::https://futhark-lang.org/releases/futhark-nightly-linux-${arch}.tar.xz") +_tarurl="https://futhark-lang.org/releases/futhark-nightly-linux-${arch}.tar.xz" +_modificationtime=$(date +%s -d "$(curl -sI ${_tarurl} | grep Last-Modified | sed s/^'Last-Modified: '//)") +source=("${pkgname}-${_modificationtime}.tar.xz::https://futhark-lang.org/releases/futhark-nightly-linux-${arch}.tar.xz") sha256sums=(SKIP) pkgver() { cd "${srcdir}/futhark-nightly-linux-${arch}" - sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' < commit-id + + if [[ $(cat commit-id) =~ "-g" ]] + then + # If commit-id contains output from `git describe` + sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' < commit-id + else + # Fallback on modification time and commit-id + printf "%s.r%s.g%s" "$(./bin/futhark -V | grep Futhark | sed "s/Futhark //")" "$_modificationtime" "$(cut -c 1-8 < commit-id)" + fi } package() { |