resolves: RHEL-113820 mlcustomize/inject_virtio_win.ml: Use viostor.inf instead of guestor resolves: RHEL-112517 Fix for setting boot order for Linux guests based on grub location resolves: RHEL-115989, RHEL-115990
74 lines
2.4 KiB
Diff
74 lines
2.4 KiB
Diff
From 1f6d4e079dd5fdc9ed4c84ada57835b733bbbe78 Mon Sep 17 00:00:00 2001
|
||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||
Date: Thu, 18 Sep 2025 12:21:58 +0100
|
||
Subject: [PATCH] convert: linux: Move uninstall_packages function below
|
||
do_convert
|
||
|
||
The structure of conversion is the do_convert () function, followed by
|
||
the subfunctions that are used for conversion. Move
|
||
uninstall_packages below do_convert so it's like all the other
|
||
functions.
|
||
|
||
This is just code motion, there is no functional change.
|
||
|
||
Updates: commit b3268a13beca4da218e7ffe4648a18420296103a
|
||
---
|
||
convert/convert_linux.ml | 37 ++++++++++++++++++-------------------
|
||
1 file changed, 18 insertions(+), 19 deletions(-)
|
||
|
||
diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
|
||
index 872fa663..f339361a 100644
|
||
--- a/convert/convert_linux.ml
|
||
+++ b/convert/convert_linux.ml
|
||
@@ -131,25 +131,6 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||
(*----------------------------------------------------------------------*)
|
||
(* Conversion step. *)
|
||
|
||
- let uninstall_packages pkgs =
|
||
- if pkgs <> [] then (
|
||
- let cmd =
|
||
- try Guest_packages.uninstall_command pkgs inspect.i_package_management
|
||
- with
|
||
- | Guest_packages.Unknown_package_manager msg
|
||
- | Guest_packages.Unimplemented_package_manager msg ->
|
||
- error "%s" msg
|
||
- in
|
||
- (try ignore (g#sh cmd)
|
||
- with G.Error msg ->
|
||
- warning (f_"could not uninstall packages ‘%s’: %s (ignored)")
|
||
- (String.concat " " pkgs) msg
|
||
- );
|
||
- (* Reload Augeas in case anything changed. *)
|
||
- Linux.augeas_reload g
|
||
- )
|
||
- in
|
||
-
|
||
let rec do_convert () =
|
||
augeas_grub_configuration ();
|
||
|
||
@@ -1378,6 +1359,24 @@ fi
|
||
"/etc/blkid/blkid.tab"; "/etc/blkid.tab";
|
||
"/etc/lvm/cache/.cache"; "/etc/lvm/devices/system.devices"
|
||
];
|
||
+
|
||
+ and uninstall_packages pkgs =
|
||
+ if pkgs <> [] then (
|
||
+ let cmd =
|
||
+ try Guest_packages.uninstall_command pkgs inspect.i_package_management
|
||
+ with
|
||
+ | Guest_packages.Unknown_package_manager msg
|
||
+ | Guest_packages.Unimplemented_package_manager msg ->
|
||
+ error "%s" msg
|
||
+ in
|
||
+ (try ignore (g#sh cmd)
|
||
+ with G.Error msg ->
|
||
+ warning (f_"could not uninstall packages ‘%s’: %s (ignored)")
|
||
+ (String.concat " " pkgs) msg
|
||
+ );
|
||
+ (* Reload Augeas in case anything changed. *)
|
||
+ Linux.augeas_reload g
|
||
+ )
|
||
in
|
||
|
||
do_convert ()
|