From 47ccd7dd9177c583b853c14b9c21cd2cc92448a8 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 5 Aug 2023 14:50:49 -0700 Subject: [PATCH] Pre-compile Python scripts in build_linux --- setup/build_linux | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup/build_linux b/setup/build_linux index 37d0762d..ec6b4a9f 100755 --- a/setup/build_linux +++ b/setup/build_linux @@ -80,6 +80,10 @@ function copy_live_env() { mkdir -p "$PROFILE_DIR/airootfs/usr/local/bin" rsync -aI "$ROOT_DIR/scripts/" "$PROFILE_DIR/airootfs/usr/local/bin/" + # Pre-compile Python scripts + unset PYTHONPYCACHEPREFIX + python -m compileall "$PROFILE_DIR/airootfs/usr/local/bin/" + # Update profiledef.sh to set proper permissions for executable files for _file in $(find "$PROFILE_DIR/airootfs" -executable -type f | sed "s%$PROFILE_DIR/airootfs%%" | sort); do sed -i "\$i\ [\"$_file\"]=\"0:0:755\"" "$PROFILE_DIR/profiledef.sh"