mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
v2v: -i ova: Prefer pigz or pxz for uncompressing OVA files (RHBZ#1448739).
If the parallel tools pigz or pxz are available, prefer them for uncompressing gz- and xz-compressed OVA files respectively. If not available then gzip or xz are used as normal.
This commit is contained in:
@@ -40,9 +40,19 @@ let libvirt_supports_json_raw_driver () =
|
||||
else
|
||||
true
|
||||
|
||||
let pigz_available =
|
||||
let test = lazy (shell_command "pigz --help >/dev/null 2>&1" = 0) in
|
||||
fun () -> Lazy.force test
|
||||
|
||||
let pxz_available =
|
||||
let test = lazy (shell_command "pxz --help >/dev/null 2>&1" = 0) in
|
||||
fun () -> Lazy.force test
|
||||
|
||||
let zcat_command_of_format = function
|
||||
| `GZip -> "gzip -c -d"
|
||||
| `XZ -> "xz -c -d"
|
||||
| `GZip ->
|
||||
if pigz_available () then "pigz -c -d" else "gzip -c -d"
|
||||
| `XZ ->
|
||||
if pxz_available () then "pxz -c -d" else "xz -c -d"
|
||||
|
||||
(* Untar part or all files from tar archive. If [paths] is specified it is
|
||||
* a list of paths in the tar archive.
|
||||
|
||||
Reference in New Issue
Block a user