Restrict release number to META version

When creating packages in a git repository the release number
can be automatically set by 'git describe'.  This normally works
well but if your repository has newer tags which match the form
NAME-VERSION* the release may be incorrectly calculated.  To
prevent this the match patten has been restricted to the contents
of the META file, NAME-VERSION.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf 2014-05-29 15:03:43 -07:00
parent 6795a698f4
commit 79aada6105

View File

@ -68,7 +68,7 @@ AC_DEFUN([ZFS_AC_META], [
ZFS_META_RELEASE=_ZFS_AC_META_GETVAL([Release]); ZFS_META_RELEASE=_ZFS_AC_META_GETVAL([Release]);
if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
_match="${ZFS_META_NAME}-${ZFS_META_VERSION}*" _match="${ZFS_META_NAME}-${ZFS_META_VERSION}"
_alias=$(git describe --match=${_match} 2>/dev/null) _alias=$(git describe --match=${_match} 2>/dev/null)
_release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g') _release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g')
if test -n "${_release}"; then if test -n "${_release}"; then