mirror of https://github.com/thesofproject/sof.git
version: Strip SOF_FW_XXX_ prefix from version number
The version information is generated using git tags and needs to be numerical for version.h usage. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
parent
ffd9093267
commit
856f768e3a
15
version.sh
15
version.sh
|
@ -10,11 +10,22 @@ else
|
|||
DIR=$1
|
||||
fi
|
||||
|
||||
# get version from git tag
|
||||
GIT_TAG=`git describe --abbrev=4`
|
||||
|
||||
# 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][A-Z][A-Z]_' ) -eq 11 ]; then
|
||||
VER=`echo $GIT_TAG | cut -d_ -f4`
|
||||
else
|
||||
VER=$GIT_TAG
|
||||
fi
|
||||
|
||||
# create git version if we are a git repo or git worktree
|
||||
if [ -e $DIR/.git -o -d $DIR/.git ]; then
|
||||
# version for make dist
|
||||
git describe --abbrev=4 > $DIR/.version
|
||||
git describe --abbrev=4 > $DIR/.tarball-version
|
||||
echo $VER > $DIR/.version
|
||||
echo $VER > $DIR/.tarball-version
|
||||
|
||||
# git commit for IPC
|
||||
echo "#define REEF_TAG \"`git log --pretty=format:\"%h\" -1 | cut -c1-5`\"" > $DIR/src/include/version.h
|
||||
|
|
Loading…
Reference in New Issue