abuild: add last commit hash to .PKGINFO
This can be useful for package browser.
This commit is contained in:
parent
28da75a264
commit
d3efd64ab1
13
abuild.in
13
abuild.in
|
@ -447,6 +447,18 @@ prepare_language_packs() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# echo '-dirty' if git is not clean
|
||||||
|
git_dirty() {
|
||||||
|
if [ $(git status -s "$startdir" | wc -l) -ne 0 ]; then
|
||||||
|
echo "-dirty"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# echo last commit hash id
|
||||||
|
git_last_commit() {
|
||||||
|
git log --format=oneline -n 1 "$startdir" | awk '{print $1}'
|
||||||
|
}
|
||||||
|
|
||||||
prepare_metafiles() {
|
prepare_metafiles() {
|
||||||
getpkgver || return 1
|
getpkgver || return 1
|
||||||
local name=${subpkgname:-$pkgname}
|
local name=${subpkgname:-$pkgname}
|
||||||
|
@ -480,6 +492,7 @@ builddate = $builddate
|
||||||
packager = ${PACKAGER:-"Unknown"}
|
packager = ${PACKAGER:-"Unknown"}
|
||||||
size = $size
|
size = $size
|
||||||
arch = $parch
|
arch = $parch
|
||||||
|
commit = $(git_last_commit)$(git_dirty)
|
||||||
EOF
|
EOF
|
||||||
local i deps
|
local i deps
|
||||||
deps="$depends"
|
deps="$depends"
|
||||||
|
|
Loading…
Reference in New Issue