Skip to content

Commit

Permalink
bee-download: git: use time of last git commit when no tag is found
Browse files Browse the repository at this point in the history
when cloning git repositories and creating packages use the unix timestamp
of the last commit when creating version information in repositories that
do not have tags.

this makes it possible to better sort those archives since just adding
the commit-sha1 doesn't help bee sorting those versions.

the commit timestamp will be added as pkgextraversion prefixed with t
(e.g. PKGEXTRAVERION=_t1234567_deadbeef). the commit-sha1 will still be
added to make is possible to identify the commit the archive was built from.

pkgversion will still be 0.
  • Loading branch information
mariux committed Apr 22, 2012
1 parent 53349ce commit c7a0c19
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bee-download.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ function download_git() {
pkgextraextraversion="_p${ahead}"
else
PKGFULLVERSION=0
commitdate=$(git log --format=format:"%ct" -1)
if [ ! -z "${commitdate}" ] ; then
pkgextraextraversion="_t${commitdate}"
fi
fi

pkgextraextraversion="${pkgextraextraversion}_${commit}"
Expand Down

0 comments on commit c7a0c19

Please sign in to comment.