Skip to content

Commit

Permalink
Update setVersionNumber.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Nov 25, 2024
1 parent c75222c commit 49a343a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions utils/setVersionNumber.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ oldversion=`cat VERSION`

echo "Changing version from $oldversion to $version"

sed -i "s/__version__ = '$oldversion'/__version__ = '$version'/g" python/src/__init__.py
sed -i'.bak' "s/__version__ = '$oldversion'/__version__ = '$version'/g" python/src/__init__.py

sed -i "s/Version: $oldversion/Version: $version/g" distro/rpm/*.spec
sed -i "s/ ($oldversion-/ ($version-/g" distro/debian/changelog
sed -i'.bak' "s/Version: $oldversion/Version: $version/g" distro/rpm/*.spec
sed -i'.bak' "s/ ($oldversion-/ ($version-/g" distro/debian/changelog

oldmajor=`echo $oldversion | cut -d "." -f 1`
oldminor=`echo $oldversion | cut -d "." -f 2`
Expand All @@ -32,13 +32,13 @@ major=`echo $version | cut -d "." -f 1`
minor=`echo $version | cut -d "." -f 2`
patch=`echo $version | cut -d "." -f 3`

sed -i "s/CPACK_PACKAGE_VERSION_MAJOR $oldmajor/CPACK_PACKAGE_VERSION_MAJOR $major/g" CMakeLists.txt
sed -i "s/CPACK_PACKAGE_VERSION_MINOR $oldminor/CPACK_PACKAGE_VERSION_MINOR $minor/g" CMakeLists.txt
sed -i'.bak' "s/CPACK_PACKAGE_VERSION_MAJOR $oldmajor/CPACK_PACKAGE_VERSION_MAJOR $major/g" CMakeLists.txt
sed -i'.bak' "s/CPACK_PACKAGE_VERSION_MINOR $oldminor/CPACK_PACKAGE_VERSION_MINOR $minor/g" CMakeLists.txt

number_of_dots=`grep -o '\.' <<< $version | wc -l`
if test $number_of_dots -ge 2
then
sed -i "s/set ( CPACK_PACKAGE_VERSION_PATCH $oldpatch/set ( CPACK_PACKAGE_VERSION_PATCH $patch/g" CMakeLists.txt
sed -i'.bak' "s/set ( CPACK_PACKAGE_VERSION_PATCH $oldpatch/set ( CPACK_PACKAGE_VERSION_PATCH $patch/g" CMakeLists.txt
fi

echo $version > VERSION
Expand Down

0 comments on commit 49a343a

Please sign in to comment.