abuild: microoptimization. call git describe only once

Use a global var for last_commit so we dont need call git for every
subpackage
This commit is contained in:
Natanael Copa 2013-07-23 07:17:37 +00:00
parent 60de2a776a
commit 3c15749bd0
1 changed files with 4 additions and 3 deletions

View File

@ -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