| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | # SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 | set -e |
| 4 | PYTHONPATH="$(dirnamescip-shell system . . dirname. "$(dirnamescip-shell system . . dirname. "$(readlinkscip-shell system . . readlink. -f "${BASH_SOURCE[0]}")")")" |
| 5 | export PYTHONPATH |
| 6 | command="$(basenamescip-shell system . . basename. "${BASH_SOURCE[0]//-/.}")" |
| 7 | |
| 8 | if [scip-shell system . . `[`. -z "$MKOSI_INTERPRETER" ]; then |
| 9 | # Note the check seems to be inverted here because the if branch is |
| 10 | # executed when the exit status is 0 which is equal to False in Python. |
| 11 | if python3scip-shell system . . python3. -c "import sys; sys.exit(sys.version_info < (3, 9))"; then |
| 12 | MKOSI_INTERPRETER=python3 |
| 13 | elif command -v python3.9 >/dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 14 | MKOSI_INTERPRETER=python3.9 |
| 15 | else |
| 16 | echoscip-shell system . . echo. "mkosi needs python 3.9 or newer (found $(python3scip-shell system . . python3. --version))" |
| 17 | exit 1 |
| 18 | fi |
| 19 | fi |
| 20 | |
| 21 | exec "$MKOSI_INTERPRETER" -B -m "$command" "$@" |