summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/abuild.in b/abuild.in
index f9c59f2..fff2f63 100755
--- a/abuild.in
+++ b/abuild.in
@@ -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"