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 02b3ac7 commit 93f796b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions utils/setVersionNumber.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +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 "s/version = '$oldversion'/version = '$version'/g" python/doc/conf.py.in
sed -i "s/release = '$oldversion'/release = '$version'/g" python/doc/conf.py.in
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 @@ -34,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 93f796b

Please sign in to comment.