diff options
Diffstat (limited to 'lib/bootstrap')
-rwxr-xr-x | lib/bootstrap | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/bootstrap b/lib/bootstrap index 68037f1..d4aa15a 100755 --- a/lib/bootstrap +++ b/lib/bootstrap @@ -23,26 +23,17 @@ elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then # If available, use the git commit revision for the package version. - months="Jan:01 Feb:02 Mar:03 Apr:04 May:05 Jun:06 Jul:07 Aug:08 \ - Sep:09 Oct:10 Nov:11 Dec:12" - # Add a date prefix for easy reading. + # date='2010-11-30 16:36:09 -0800' - date=$(git-log --pretty=format:"%cD" -1 HEAD) - - # date='Fri, 2 Aug 2007 19:36:06 -0700' - - date=${date##*, } - date=${date% [0-9][0-9]:*} - day=${date%* [A-Z][a-z][a-z] *} - year=${date##* [A-Z][a-z][a-z] 20} - month=${date##${day} } - month=${month%% 20${year}} - month=${months##*${month}:} - month=${month%% *} - [ ! ${day#[0-9][0-9]} ] || day="0$day" + date=$(git log --pretty=format:"%ci" -1 HEAD) + date=${date##20} + date=${date%%:[0-9][0-9] *} + date=${date//-/.} + date=${date// /.} + date=${date//:/.} - version=$(printf '%s.%s.%s-%s%s' ${year} ${month} ${day} g ${head}) + version=$(printf '%s-%s%s' ${date} g ${head}) # Add a '-dirty' postfix for uncommitted changes. @@ -50,7 +41,7 @@ elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then version=`printf '%s%s' ${version} -dirty` fi else - # Default to date and time. + # Default to current date and time. version="dev-$(date +%y.%m.%d-%H.%M.%S)" fi |