Improve log rotation, early-exit find_bundle, fix uninstall orphaned backup

apply.sh: preserve two log generations (.1 and .2) on rotation so the
last two boots are always available for diagnosis.

patch_ui.py: find_bundle returns on the first matching JS file instead of
collecting all matches. The multi-match warning was dead weight — the Angular
Ivy compiler produces exactly one bundle and the WARNING path was unreachable
in practice.

uninstall.sh: restore an orphaned sitecustomize.py.pre-truecloud-patch when
sitecustomize.py itself has already been removed (e.g. manual deletion while
the backup survived). Prevents leaving ghost vendor files in site-packages.
This commit is contained in:
2026-06-15 03:43:03 +00:00
parent 49bd775d42
commit 91c607a707
3 changed files with 13 additions and 16 deletions
+9
View File
@@ -76,6 +76,15 @@ if [ -n "$SITE_PKG" ] && [ -f "$SITE_PKG/sitecustomize.py" ]; then
else
echo " Not found (already removed or install didn't place it here)."
fi
# Handle orphaned backup when sitecustomize.py was removed (e.g. by a TrueNAS
# update) but the .pre-truecloud-patch file survived in the same directory.
if [ -n "$SITE_PKG" ] && [ ! -f "$SITE_PKG/sitecustomize.py" ] && \
[ -f "$SITE_PKG/sitecustomize.py.pre-truecloud-patch" ]; then
mv "$SITE_PKG/sitecustomize.py.pre-truecloud-patch" \
"$SITE_PKG/sitecustomize.py"
echo " Restored orphaned sitecustomize.py backup"
fi
echo ""
# ── Restore UI bundle ─────────────────────────────────────────────────────────