diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-08 09:50:17 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-08 09:50:17 +0000 |
commit | d3efd64ab1f21946e3cce436ab712505fddb5ce0 (patch) | |
tree | bb7c5644e266fc4a578c47472d0bb513a008bd6f | |
parent | 28da75a2643f2f79daf16c20deed744aac1b390e (diff) | |
download | abuild-d3efd64ab1f21946e3cce436ab712505fddb5ce0.tar.gz abuild-d3efd64ab1f21946e3cce436ab712505fddb5ce0.tar.bz2 abuild-d3efd64ab1f21946e3cce436ab712505fddb5ce0.tar.xz abuild-d3efd64ab1f21946e3cce436ab712505fddb5ce0.zip |
abuild: add last commit hash to .PKGINFO
This can be useful for package browser.
-rwxr-xr-x | abuild.in | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -447,6 +447,18 @@ prepare_language_packs() { 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() { getpkgver || return 1 local name=${subpkgname:-$pkgname} @@ -480,6 +492,7 @@ builddate = $builddate packager = ${PACKAGER:-"Unknown"} size = $size arch = $parch +commit = $(git_last_commit)$(git_dirty) EOF local i deps deps="$depends" |