Pre-compile Python scripts in build_linux

This commit is contained in:
2Shirt 2023-08-05 14:50:49 -07:00
parent 24e4f7ddcc
commit 47ccd7dd91
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -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"