forked from nuttx/nuttx-update
tools/version: generate dummy version without breakout
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
c137abf4b0
commit
d96189ce26
1 changed files with 3 additions and 4 deletions
|
@ -76,7 +76,7 @@ if [ -z ${VERSION} ] ; then
|
||||||
# If the VERSION does not match X.Y.Z, retrieve version from the tag
|
# If the VERSION does not match X.Y.Z, retrieve version from the tag
|
||||||
|
|
||||||
if [[ ! ${VERSION} =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]] ; then
|
if [[ ! ${VERSION} =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]] ; then
|
||||||
VERSION=`git -C ${WD} -c 'versionsort.suffix=-' tag --sort=v:refname | grep -E "nuttx-[0-9]+\.[0-9]+\.[0-9]+" | tail -1 | cut -d'-' -f2-`
|
VERSION=`git -C ${WD} -c 'versionsort.suffix=-' tag --sort=v:refname 2>/dev/null | grep -E "nuttx-[0-9]+\.[0-9]+\.[0-9]+" | tail -1 | cut -d'-' -f2-`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@ -117,12 +117,11 @@ PATCH=`echo ${VERSION} | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" | cut -d'.' -f3`
|
||||||
# Get GIT information (if not provided on the command line)
|
# Get GIT information (if not provided on the command line)
|
||||||
|
|
||||||
if [ -z "${BUILD}" ]; then
|
if [ -z "${BUILD}" ]; then
|
||||||
BUILD=`git -C ${WD} log --oneline -1 | cut -d' ' -f1 2>/dev/null`
|
BUILD=`git -C ${WD} log --oneline -1 2>/dev/null | cut -d' ' -f1`
|
||||||
if [ -z "${BUILD}" ]; then
|
if [ -z "${BUILD}" ]; then
|
||||||
echo "GIT version information is not available"
|
echo "GIT version information is not available"
|
||||||
exit 5
|
|
||||||
fi
|
fi
|
||||||
if [ -n "`git -C ${WD} diff-index --name-only HEAD | head -1`" ]; then
|
if [ -n "`git -C ${WD} diff-index --name-only HEAD 2>/dev/null | head -1`" ]; then
|
||||||
BUILD=${BUILD}-dirty
|
BUILD=${BUILD}-dirty
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue