repo-mirror.sh: The python3 interpreter call is now more portable.
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-bii_scripts/bin/repo-mirror.sh new-bii_scripts/bin/repo-mirror.sh
--- old-bii_scripts/bin/repo-mirror.sh 2022-09-26 05:48:25.149157128 +0200
+++ new-bii_scripts/bin/repo-mirror.sh 2022-09-26 05:48:25.149157128 +0200
@@ -84,10 +84,21 @@
fi
}
+function python_bin {
+ # get name of python binary
+ CMD "python3 --version >/dev/null 2>&1"
+ if [ $cmdret == 0 ]; then
+ echo "python3"
+ else
+ echo "python"
+ fi
+}
+
function python_check_module {
# $1: module name
# $2: module name in pip
- CMD "python -c 'import $1' 2>/dev/null"
+ _python=$(python_bin)
+ CMD "$_python -c 'import $1' 2>/dev/null"
if [ $cmdret -ne 0 ]; then
echo "error, you must run pip install --user $2 first"
exit 1
patch 02f5bfbf904ab46ea49209070de30c82d06ab9be
Author: Goetz.Pfeiffer@helmholtz-berlin.de
Date: Mon Feb 21 15:45:24 CET 2022
* repo-mirror.sh: The python3 interpreter call is now more portable