diff --git a/.gitignore b/.gitignore index b2891b4d6deb..f940e7edf6d5 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,6 @@ *.rom *.man .version -.tarball-version *.x .build *.dis diff --git a/.tarball-version b/.tarball-version new file mode 100644 index 000000000000..f367bd89e72f --- /dev/null +++ b/.tarball-version @@ -0,0 +1 @@ +v1.1-185-g3507 diff --git a/version.sh b/version.sh index 76a522e89a13..cb133b87403f 100755 --- a/version.sh +++ b/version.sh @@ -15,14 +15,18 @@ fi GIT_TAG=`git describe --abbrev=4 2>/dev/null` # may fail to get git describe in some case, add this fallback to handle error -if [[ "x$GIT_TAG" == "x" ]] -then - GIT_TAG="v0.0-0-g0000" +if [[ "x$GIT_TAG" == "x" ]]; then + if [ -e $DIR/.tarball-version ]; then + VER=$(cat $DIR/.tarball-version) + echo $VER > $DIR/.version + else + GIT_TAG="v0.0-0-g0000" + fi fi # Some releases have a SOF_FW_XXX_ prefix on the tag and this prefix # must be stripped for usage in version.h. i.e. we just need the number. -if [ $(expr match $GIT_TAG 'SOF_FW_[A-Z]+_' ) -lt 15 ]; then +if [ $(expr match "$GIT_TAG" 'SOF_FW_[A-Z]+_' ) -lt 15 ]; then VER=`echo $GIT_TAG | cut -d_ -f4` else VER=$GIT_TAG