diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index 327991ac0..811513785 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -52,7 +52,6 @@ object method as_options = "-i ova " ^ ova method source () = - (* Untar part or all files from tar archive. If [paths] is specified it is * a list of paths in the tar archive. *) diff --git a/v2v/linux.ml b/v2v/linux.ml index d979d4d94..8b49fe643 100644 --- a/v2v/linux.ml +++ b/v2v/linux.ml @@ -44,14 +44,14 @@ let rec remove g inspect packages = augeas_reload g ) -and do_remove g inspect packages = +and do_remove g { i_package_format = package_format } packages = assert (List.length packages > 0); - let package_format = inspect.i_package_format in match package_format with | "deb" -> let cmd = [ "dpkg"; "--purge" ] @ packages in let cmd = Array.of_list cmd in ignore (g#command cmd); + | "rpm" -> let cmd = [ "rpm"; "-e" ] @ packages in let cmd = Array.of_list cmd in @@ -62,15 +62,14 @@ and do_remove g inspect packages = format (String.concat " " packages) let file_list_of_package (g : Guestfs.guestfs) inspect app = - let package_format = inspect.i_package_format in - - match package_format with + match inspect.i_package_format with | "deb" -> let cmd = [| "dpkg"; "-L"; app.G.app2_name |] in debug "%s" (String.concat " " (Array.to_list cmd)); let files = g#command_lines cmd in let files = Array.to_list files in List.sort compare files + | "rpm" -> (* Since RPM allows multiple packages installed with the same * name, always check the full ENVR here (RHBZ#1161250). @@ -101,12 +100,12 @@ let file_list_of_package (g : Guestfs.guestfs) inspect app = let files = g#command_lines cmd in let files = Array.to_list files in List.sort compare files + | format -> error (f_"don't know how to get list of files from package using %s") format -let rec file_owner (g : G.guestfs) inspect path = - let package_format = inspect.i_package_format in +let rec file_owner (g : G.guestfs) { i_package_format = package_format } path = match package_format with | "deb" -> (* With dpkg usually the directories are owned by all the packages @@ -129,8 +128,10 @@ let rec file_owner (g : G.guestfs) inspect path = let line = try String.sub line 0 (String.rindex line ':') with Invalid_argument _ -> - error (f_"internal error: file_owner: invalid dpkg output: '%s'") line in + error (f_"internal error: file_owner: invalid dpkg output: '%s'") + line in fst (String.split "," line) + | "rpm" -> (* Although it is possible in RPM for multiple packages to own * a file, this deliberately only returns one package. diff --git a/v2v/output_glance.ml b/v2v/output_glance.ml index d6f5e0de0..c372b0ada 100644 --- a/v2v/output_glance.ml +++ b/v2v/output_glance.ml @@ -69,7 +69,7 @@ object (* See #supported_firmware above. *) assert (target_firmware = TargetBIOS); - (* The first disk, assumed to be the system, will be called + (* The first disk, assumed to be the system disk, will be called * "guestname". Subsequent disks, assumed to be data disks, * will be called "guestname-disk2" etc. The manual strongly * hints you should import the data disks to Cinder.