diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-23 07:17:37 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-23 07:17:37 +0000 |
commit | 3c15749bd07a5ebd92ece505bb6b24f698c36fe2 (patch) | |
tree | 3e4ca164feadeddacb1bed7db8b6a9a99ba80d61 /abuild.in | |
parent | 60de2a776a298ed92b8dd405bbe553ec33517df6 (diff) | |
download | abuild-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
Diffstat (limited to 'abuild.in')
-rwxr-xr-x | abuild.in | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 |