1
0

fix: correct package cleanup commands in netupgrade

Use apt-get autoremove --purge instead of a separate empty purge step, and pass the CLI yes flag through to apk upgrade so the logged commands match actual behavior.
This commit is contained in:
2026-04-26 00:40:24 +02:00
parent 3fe7959850
commit e2b3a0a88d
2 changed files with 6 additions and 8 deletions
+2 -1
View File
@@ -90,7 +90,6 @@ Supported action types currently include:
### Short term
- Tackle the next hardening work as small, reviewable commits instead of one broad patch
- Review package-manager cleanup steps that look incorrect or misleading, such as `apt-get purge` without arguments and the current `apk` `-y` handling
- Review the remaining quoting-sensitive areas, especially around remote shell command construction
### Medium term
@@ -121,6 +120,8 @@ Supported action types currently include:
- `whiptail` checklist defaults are now passed explicitly as `ON`/`OFF`, and selected items are parsed through a dedicated helper instead of relying on raw shell word splitting
- The CLI help and README now clarify that `-f` preselects all nodes in the interactive checklist
- Log summary generation no longer uses `sed -i` interpolation; the script now writes a temporary file with the summary header plus the existing log content and replaces the original log atomically
- The `apk` action now applies `-y` to `apk upgrade` when the CLI `-y` flag is set, making its behavior consistent with the documented intent for supported package managers
- The `apt` action now uses `apt-get autoremove --purge` and no longer runs `apt-get purge` without arguments, which makes the cleanup step more meaningful and avoids a misleading command in the log
## Change guidance
- Preserve backward compatibility for existing config files where possible