From c7a0c198793da88522b441319cc6d5591ddb3368 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 23 Apr 2012 00:07:45 +0200 Subject: [PATCH] bee-download: git: use time of last git commit when no tag is found 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. --- src/bee-download.sh.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bee-download.sh.in b/src/bee-download.sh.in index c376595..41fd1dd 100644 --- a/src/bee-download.sh.in +++ b/src/bee-download.sh.in @@ -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}"