Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*.rom
*.man
.version
.tarball-version
*.x
.build
*.dis
Expand Down
1 change: 0 additions & 1 deletion .tarball-version

This file was deleted.

12 changes: 4 additions & 8 deletions version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@ 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
if [ -e $DIR/.tarball-version ]; then
VER=$(cat $DIR/.tarball-version)
echo $VER > $DIR/.version
else
GIT_TAG="v0.0-0-g0000"
fi
if [[ "x$GIT_TAG" == "x" ]]
then
GIT_TAG="v0.0-0-g0000"
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
Expand Down