@@ -22,12 +22,10 @@ cd ..
2222echo " The following modules will be pinned:"
2323for module in $modules ; do
2424 version=$( python -c " import $module ; print($module .__version__)" )
25-
2625 if [[ -z " $version " ]]; then
2726 echo " Error: Could not retrieve version for $module "
2827 exit 1
2928 fi
30-
3129 echo " - ${module} : $version "
3230done
3331
4947echo " Updating version information in configuration files..."
5048for module in $modules ; do
5149 version=$( python -c " import $module ; print($module .__version__)" )
52-
5350 if [[ -z " $version " ]]; then
5451 echo " Error: Could not retrieve version for $module "
5552 exit 1
5653 fi
57-
58- # Update version in three different files with appropriate patterns
59- sed -i " s/\('${module} ' *:\).*/\1 '${version} ',/" xboinc/general.py
60- sed -i " s/\('${module} ' *:\).*/\1 '${version} ',/" tests/test_version.py
61- sed -i " s/\(${module} *=\).*/\1 '==${version} '/" pyproject.toml
62-
54+ if [[ " $OSTYPE " == " darwin" * ]]
55+ then
56+ # Update version in three different files with appropriate patterns
57+ sed -i ' ' " s/\('" ${module} " ' *:\).*/\1 '" ${version} " ',/" xboinc/general.py
58+ sed -i ' ' " s/\(" ${module} " *=\).*/\1 '==" ${version} " '/" pyproject.toml
59+ sed -i ' ' " s/\('" ${module} " ' *:\).*/\1 '" ${version} " '/" tests/test_version.py
60+ else
61+ # Update version in three different files with appropriate patterns
62+ sed -i " s/\('" ${module} " ' *:\).*/\1 '" ${version} " ',/" xboinc/general.py
63+ sed -i " s/\(" ${module} " *=\).*/\1 '==" ${version} " '/" pyproject.toml
64+ sed -i " s/\('" ${module} " ' *:\).*/\1 '" ${version} " '/" tests/test_version.py
65+ fi
6366 echo " - Pinned ${module} to version ${version} "
6467done
6568
69+ # ----- Update app version in C source -----
70+ appver=$( python -c " import xboinc; print(xboinc.app_version_int)" )
71+ if [[ " $OSTYPE " == " darwin" * ]]
72+ then
73+ sed -i ' ' " s/\(int64_t xboinc_exec_version =\).*/\1 " ${appver} " ;/" xboinc/executable/version.h
74+ else
75+ sed -i " s/\(int64_t xboinc_exec_version =\).*/\1 " ${appver} " ;/" xboinc/executable/version.h
76+ fi
77+
6678echo " Version pinning completed successfully."
6779exit 0
0 commit comments