summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2014-06-12 19:49:02 +0200
committercos <cos>2014-06-12 19:49:02 +0200
commite810738353fc801a6615fe0f591617b7174ffbab (patch)
tree76dfc9f6053ed453321410cdc35132acd126c50f
parentf9eab7ee2f8b7c5a01356ad1622ad979f377cf8d (diff)
downloadgo-webbrowser-launcher-e810738353fc801a6615fe0f591617b7174ffbab.zip
Automatically generate version from commit history.
-rwxr-xr-xgen-package17
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