mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
v2v: ova: move the untar function
Move the untar function so it can be used later in the code. Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
This commit is contained in:
committed by
Pino Toscano
parent
347e4b1648
commit
8644ea7242
@@ -38,6 +38,12 @@ object
|
||||
method as_options = "-i ova " ^ ova
|
||||
|
||||
method source () =
|
||||
|
||||
let untar ?(format = "") file outdir =
|
||||
let cmd = [ "tar"; sprintf "-x%sf" format; file; "-C"; outdir ] in
|
||||
if run_command cmd <> 0 then
|
||||
error (f_"error unpacking %s, see earlier error messages") ova in
|
||||
|
||||
(* Extract ova file. *)
|
||||
let exploded =
|
||||
(* The spec allows a directory to be specified as an ova. This
|
||||
@@ -61,11 +67,6 @@ object
|
||||
|
||||
tmpfile in
|
||||
|
||||
let untar ?(format = "") file outdir =
|
||||
let cmd = [ "tar"; sprintf "-x%sf" format; file; "-C"; outdir ] in
|
||||
if run_command cmd <> 0 then
|
||||
error (f_"error unpacking %s, see earlier error messages") ova in
|
||||
|
||||
match detect_file_type ova with
|
||||
| `Tar ->
|
||||
(* Normal ovas are tar file (not compressed). *)
|
||||
|
||||
Reference in New Issue
Block a user