Fix four audit findings; simplify apply.sh boolean gate

- uninstall.sh: track _restore_failed separately from RESTORED so
  "No backup files found" only prints when find returns nothing (not
  when mv fails on existing backups); abort with exit 1 before rm -rf
  when any restore fails, leaving PATCH_DIR and recover.sh intact
- install.sh: extend log-scan grep to catch ERROR: lines from
  patch_ui.py (backup OSError was silently missed by WARNING:-only grep)
- install.sh: reword restart-failure message — hook IS already
  registered and sitecustomize.py IS installed; patch activates on
  next boot regardless
- apply.sh: replace `if $_can_install` with `[ "$_can_install" = true ]`
  (explicit test, no implicit command lookup); drop 2>/dev/null on
  install cp so OS error detail reaches the log
This commit is contained in:
2026-06-15 16:26:00 +00:00
parent 0b597387bd
commit fa6f6605b0
3 changed files with 17 additions and 5 deletions
+2 -2
View File
@@ -97,8 +97,8 @@ else
fi
fi
if $_can_install; then
if cp "$PATCH_DIR/sitecustomize.py" "$SITE_PKG/sitecustomize.py" 2>/dev/null; then
if [ "$_can_install" = true ]; then
if cp "$PATCH_DIR/sitecustomize.py" "$SITE_PKG/sitecustomize.py"; then
echo "OK: Installed sitecustomize.py → $SITE_PKG/sitecustomize.py"
else
echo "WARNING: Failed to write $SITE_PKG/sitecustomize.py (permission error?)"