Install only missing packages across all common-utils package sets#1644
Conversation
… of PACKAGES_ALREADY_INSTALLED)
chrmarti
left a comment
There was a problem hiding this comment.
A few review notes on the per-package install change. The core direction looks great — these are mostly small follow-ups.
Dead variable (issue 2): With the per-package check now inlined, PACKAGES_ALREADY_INSTALLED no longer gates anything inside install_debian_packages / install_redhat_packages / install_alpine_packages (it's still loaded from the marker file in the main section and set at the end of all three functions, but the guards that used to read it are gone — see lines 166, 285, 367 in src/common-utils/main.sh). The variable is effectively dead within these functions. Worth a follow-up cleanup, either here or in a separate PR, to avoid confusion for future readers.
README/NOTES (issue 5): bubblewrap and socat aren't mentioned in src/common-utils/README.md or src/common-utils/NOTES.md. Since the feature advertises a curated set of common command-line utilities, it's probably worth listing them (and noting the bubblewrap dependency, since it's a less obvious addition than socat).
…ocs and tests - Add \n to dpkg-query format string so glob patterns like libicu[0-9][0-9] that match multiple packages get each status on its own line - Remove dead PACKAGES_ALREADY_INSTALLED variable from all three install functions and the marker file (per-package checks make it redundant) - Document bubblewrap and socat in NOTES.md - Add bubblewrap/socat checks to alpine, alma-9, fedora, and rocky-9 tests#
8bab70c to
f142c4f
Compare
✨ Enhancement
What does this improve?
The previous change only applied “install if missing” behavior to
bubblewrapandsocat. This expands that behavior to the full distro-specific package sets incommon-utils, so prebuilt images avoid redundant installs while still converging to the expected package baseline.Why is this valuable?
It preserves idempotent behavior for images that already contain part (or most) of the toolchain, reduces unnecessary package operations, and keeps feature behavior consistent across Debian/Ubuntu, RHEL-family, and Alpine.
Implementation approach:
missing_package_listviadpkg-query.apt-get.missing_package_listviarpm -q.missing_package_listviaapk info -e.apk add.