Skip to content

Commit

Permalink
Merge pull request #3010 from keszybz/mkosi-sandbox-wrapper
Browse files Browse the repository at this point in the history
Add bin/mkosi-initrd and bin/mkosi-sandbox wrappers and some cleanups
  • Loading branch information
DaanDeMeyer authored Sep 12, 2024
2 parents 26ec41b + 6f753c8 commit f7fddc7
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 147 deletions.
7 changes: 4 additions & 3 deletions bin/mkosi
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
set -e
PYTHONPATH="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
export PYTHONPATH
command="$(basename "${BASH_SOURCE[0]//-/.}")"

if [ -z "$MKOSI_INTERPRETER" ]; then
# Note the check seems to be inverted here because the if branch is executed when the exit status is 0
# which is equal to "False" in python.
# Note the check seems to be inverted here because the if branch is
# executed when the exit status is 0 which is equal to False in Python.
if python3 -c "import sys; sys.exit(sys.version_info < (3, 9))"; then
MKOSI_INTERPRETER=python3
elif command -v python3.9 >/dev/null; then
Expand All @@ -17,4 +18,4 @@ if [ -z "$MKOSI_INTERPRETER" ]; then
fi
fi

exec "$MKOSI_INTERPRETER" -B -m mkosi "$@"
exec "$MKOSI_INTERPRETER" -B -m "$command" "$@"
1 change: 1 addition & 0 deletions bin/mkosi-initrd
1 change: 1 addition & 0 deletions bin/mkosi-sandbox
Loading

0 comments on commit f7fddc7

Please sign in to comment.