From e810738353fc801a6615fe0f591617b7174ffbab Mon Sep 17 00:00:00 2001 From: cos Date: Thu, 12 Jun 2014 19:49:02 +0200 Subject: Automatically generate version from commit history. --- gen-package | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 Description: Wrapper script to conveniently(sic?) launch web browsers. Section: base -- cgit v1.2.3