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:
@@ -22,7 +22,9 @@ PATCH_DIR="/data/truecloud-patch"
|
||||
LOG="$PATCH_DIR/apply.log"
|
||||
|
||||
# Rotate log at 512 KB to avoid unbounded growth on a system volume.
|
||||
# Keep one prior generation (.1) so the last two boots are always available.
|
||||
if [ -f "$LOG" ] && [ "$(wc -c < "$LOG")" -gt 524288 ]; then
|
||||
[ -f "${LOG}.1" ] && mv "${LOG}.1" "${LOG}.2"
|
||||
mv "$LOG" "${LOG}.1"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user