v2v: Various whitespace or other very minor cleanups.

This commit is contained in:
Richard W.M. Jones
2017-02-25 20:13:22 +00:00
parent eb4357b767
commit 073a5cd976
3 changed files with 10 additions and 10 deletions

View File

@@ -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.
*)

View File

@@ -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.

View File

@@ -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.