summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-07-23 07:17:37 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-23 07:17:37 +0000
commit3c15749bd07a5ebd92ece505bb6b24f698c36fe2 (patch)
tree3e4ca164feadeddacb1bed7db8b6a9a99ba80d61
parent60de2a776a298ed92b8dd405bbe553ec33517df6 (diff)
downloadabuild-3c15749bd07a5ebd92ece505bb6b24f698c36fe2.tar.gz
abuild-3c15749bd07a5ebd92ece505bb6b24f698c36fe2.tar.bz2
abuild-3c15749bd07a5ebd92ece505bb6b24f698c36fe2.tar.xz
abuild-3c15749bd07a5ebd92ece505bb6b24f698c36fe2.zip
abuild: microoptimization. call git describe only once
Use a global var for last_commit so we dont need call git for every subpackage
-rwxr-xr-xabuild.in7
1 files changed, 4 insertions, 3 deletions
diff --git a/abuild.in b/abuild.in
index ea0ad02..e6969fa 100755
--- a/abuild.in
+++ b/abuild.in
@@ -808,10 +808,11 @@ EOF
done
fi
- local last_commit="$(git_last_commit)$(git_dirty)"
- if [ -n "$last_commit" ]; then
- echo "commit = $last_commit" >> "$pkginfo"
+ # store last_commit in global var so we only call git once
+ if [ -z "$last_commit" ]; then
+ last_commit="$(git_last_commit)$(git_dirty)"
fi
+ echo "commit = $last_commit" >> "$pkginfo"
get_maintainer
if [ -n "$maintainer" ]; then