diff options
author | cos <cos> | 2014-06-12 19:49:02 +0200 |
---|---|---|
committer | cos <cos> | 2014-06-12 19:49:02 +0200 |
commit | e810738353fc801a6615fe0f591617b7174ffbab (patch) | |
tree | 76dfc9f6053ed453321410cdc35132acd126c50f | |
parent | f9eab7ee2f8b7c5a01356ad1622ad979f377cf8d (diff) | |
download | go-webbrowser-launcher-e810738353fc801a6615fe0f591617b7174ffbab.zip |
Automatically generate version from commit history.
-rwxr-xr-x | gen-package | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gen-package b/gen-package index f786ca3..dcb2c0b 100755 --- a/gen-package +++ b/gen-package @@ -2,8 +2,23 @@ set -e +git_version() +{ + local date rev + + date=`git log --date=iso|sed --silent \ + 's/^Date:\s*\([0-9]*\)-\([0-9]*\)-\([0-9]*\) [0-9]*.*/\1\2\3/p'|sort| + tail -1` + + rev=`git log --date=iso|sed --silent \ + 's/^Date:\s*\([0-9]*\)-\([0-9]*\)-\([0-9]*\) [0-9]*.*/\1\2\3/p'| + grep $date|wc -l` + + printf "%s" $date-$rev +} + CONTROL='Package: go-webbrowser-launcher -Version: 20140601-1 +Version: '`git_version`' Maintainer: cos <cos> Description: Wrapper script to conveniently(sic?) launch web browsers. Section: base |