From 8165a076e49fe479148cb52e50089aa50ead390f Mon Sep 17 00:00:00 2001 From: Vincent Kobel Date: Sat, 5 May 2018 11:32:57 +0200 Subject: [PATCH] auto pkgver --- .SRCINFO | 4 ++-- PKGBUILD | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index bdce9ef..307dc91 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = gvisor-git pkgdesc = User-space kernel, sandboxed container runtime - pkgver = 42.b5a0667 - pkgrel = 2 + pkgver = r42.b5a0667 + pkgrel = 1 url = https://github.com/google/gvisor arch = x86_64 license = Apache-2.0 diff --git a/PKGBUILD b/PKGBUILD index a0e8bfb..6f0cb47 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,8 +2,8 @@ _pkgname='gvisor' pkgname="${_pkgname}-git" -pkgver=42.b5a0667 -pkgrel=2 +pkgver=r42.b5a0667 +pkgrel=1 pkgdesc="User-space kernel, sandboxed container runtime" arch=('x86_64') url='https://github.com/google/gvisor' @@ -13,6 +13,11 @@ source=("git+https://github.com/google/${_pkgname}") provides=('runsc') makedepends=('bazel' 'python') +pkgver() { + cd "${_pkgname}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + build() { cd "${srcdir}/${_pkgname}" bazel build runsc