mirror of
https://github.com/archlinux/aur.git
synced 2026-02-10 06:54:23 +01:00
PKGBUILD: update pkgver() to show FETCH_HEAD commit date
- paru and yay re-run `prepare()` twice so we need a workaround to make `pkgver()` output the same in any circumstances. Signed-off-by: shadichy <shadichy@blisslabs.org>
This commit is contained in:
parent
aaaa03dac2
commit
e40f35bcf0
1 changed files with 4 additions and 6 deletions
10
PKGBUILD
10
PKGBUILD
|
|
@ -149,11 +149,8 @@ prepare() {
|
|||
ln -s ../linux "$srcdir/linux"
|
||||
fi
|
||||
|
||||
cd "$srcdir/linux"
|
||||
|
||||
_upstream_last_commit_date=$(git log --format='%cd' -n1 --date=iso-strict)
|
||||
|
||||
# Apply patches
|
||||
cd "$srcdir/linux"
|
||||
git am --empty=keep --whitespace=fix "$srcdir"/0*.patch
|
||||
}
|
||||
|
||||
|
|
@ -162,10 +159,11 @@ pkgver() {
|
|||
|
||||
# Version format: YYYY.MM.DD.r<commitcount>.<commitsha>
|
||||
# with date from _upstream_last_commit_date
|
||||
local commit_count commit_sha
|
||||
local commit_count commit_sha head_date
|
||||
commit_count=$(git rev-list --count FETCH_HEAD..HEAD)
|
||||
commit_sha=$(git rev-parse --short HEAD)
|
||||
date +'%Y.%m.%d.r'"${commit_count}"'.'"${commit_sha}" -d "${_upstream_last_commit_date}"
|
||||
head_date=$(git show -s --format='%cI' FETCH_HEAD)
|
||||
date +'%Y.%m.%d.r'"${commit_count}"'.'"${commit_sha}" -d "${head_date}"
|
||||
}
|
||||
|
||||
build() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue