3 # This generates a version string which includes recent version as
4 # specified in correspondent sub project's configure.in file, plus
5 # git revision abbreviation in the case if sub-project HEAD is different
6 # from recent tag, plus "-dirty" suffix if local uncommitted changes are
7 # in the sub project tree.
12 echo "Usage: $0 <target>"
22 conf_file=$package/configure.in
23 version=`cat $conf_file | sed -ne '/AC_INIT.*'$package'.*/s/^AC_INIT.*'$package', \(.*\),.*$/\1/p'`
25 git diff --quiet $package-$version..HEAD -- $package > /dev/null 2>&1
26 if [ $? -eq 1 ] ; then
27 abbr=`git rev-parse --short --verify HEAD 2>/dev/null`
28 if [ ! -z "$abbr" ] ; then
29 version="${version}_${abbr}"
33 git diff-index --quiet HEAD -- $package > /dev/null 2>&1
34 if [ $? -eq 1 ] ; then
35 version="${version}_dirty"