Propose simplification in version determination by deleting all non numeric characters

This doesn't change the behavior but I found it much easier to maintain in my own code than.
This commit is contained in:
Konrad Kleine 2021-04-09 14:42:31 +00:00 committed by Sylvestre Ledru
parent 29bb4b8eab
commit b049346dd2

6
debian/orig-tar.sh vendored
View File

@ -140,9 +140,9 @@ if test -z "$TAG" -a -z "$FINAL_RELEASE"; then
# In general, in Debian, we will keep X until X.0.1 is released (or rc in experimental)
# However, on apt.llvm.org, we will update the version to have X.0.1
# This code is doing that.
MAJOR=$(grep "set(LLVM_VERSION_MAJOR" llvm/CMakeLists.txt|sed -e "s|.*LLVM_VERSION_MAJOR \(.*\))|\1|")
MINOR=$(grep "set(LLVM_VERSION_MINOR" llvm/CMakeLists.txt|sed -e "s|.*LLVM_VERSION_MINOR \(.*\))|\1|")
PATCH=$(grep "set(LLVM_VERSION_PATCH" llvm/CMakeLists.txt|sed -e "s|.*LLVM_VERSION_PATCH \(.*\))|\1|")
MAJOR=$(grep "set(LLVM_VERSION_MAJOR" llvm/CMakeLists.txt|tr -d -c '[0-9]')
MINOR=$(grep "set(LLVM_VERSION_MINOR" llvm/CMakeLists.txt|tr -d -c '[0-9]')
PATCH=$(grep "set(LLVM_VERSION_PATCH" llvm/CMakeLists.txt|tr -d -c '[0-9]')
CURRENT_VERSION="$MAJOR.$MINOR.$PATCH"
fi
# the + is here to make sure that this version is considered more recent than the svn