Skip to content

Commit 31065bc

Browse files
committed
Update version pinning
1 parent e4b3ec9 commit 31065bc

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

pin_xsuite_versions.sh

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ cd ..
2222
echo "The following modules will be pinned:"
2323
for 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"
3230
done
3331

@@ -49,19 +47,33 @@ esac
4947
echo "Updating version information in configuration files..."
5048
for 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}"
6467
done
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+
6678
echo "Version pinning completed successfully."
6779
exit 0

0 commit comments

Comments
 (0)