On 06/06/22 16:20, Laszlo Ersek wrote:
Factor the following internal functions from "guestfs-tools/customize" at commit 40b28512f700 ("Version 1.49.2.", 2022-05-26):
- guest_install_command - guest_update_command - guest_uninstall_command
into a new interface in "libguestfs-common/mlcustomize".
Keep the "error_unknown_package_manager" and "error_unimplemented_package_manager" helpers hidden from the interface. Rewrap their message strings. Move them to the front, and make them raise new exception types rather than exiting directly with "Tools_utils.error".
Strip the "guest_" prefix from the exposed functions' names, as external referrers will qualify the functions with the "Guest_packages" interface name anyway.
In all three functions, replace the common
g#inspect_get_package_management root
call (wherein the original context provides both "g" and "root") with a new parameter that is the result of that call; name it "package_management".
Write new documentation for the interface.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2028764 Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- mlcustomize/Makefile.am | 2 + mlcustomize/guest_packages.mli | 44 +++++++ mlcustomize/guest_packages.ml | 132 ++++++++++++++++++++ 3 files changed, 178 insertions(+)
Commit 9e990f3e4530, with Rich's R-b from <https://listman.redhat.com/archives/libguestfs/2022-June/029106.html>. Thanks, Laszlo