search for: do_cp

Displaying 20 results from an estimated 32 matches for "do_cp".

Did you mean: do_cpy
2017 Mar 07
0
[PATCH v4 7/9] dib: move do_cp to mllib.Commun_utils
...hanged, 8 insertions(+), 4 deletions(-) diff --git a/dib/utils.ml b/dib/utils.ml index da5e738ad..e769ebe28 100644 --- a/dib/utils.ml +++ b/dib/utils.ml @@ -95,10 +95,6 @@ let require_tool tool = with Executable_not_found tool -> error (f_"%s needed but not found") tool -let do_cp src destdir = - let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in - if run_command cmd <> 0 then exit 1 - let ensure_trailing_newline str = if String.length str > 0 && str.[String.length str - 1] <> '\n' then str ^ "\n" e...
2017 Mar 23
0
[PATCH v5 07/10] dib: move do_cp to mllib.Commun_utils
...on_utils.mli | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dib/utils.ml b/dib/utils.ml index 967754d95..92296d173 100644 --- a/dib/utils.ml +++ b/dib/utils.ml @@ -98,10 +98,6 @@ let get_required_tool tool = let require_tool tool = ignore (get_required_tool tool) -let do_cp src destdir = - let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in - if run_command cmd <> 0 then exit 1 - let ensure_trailing_newline str = if String.length str > 0 && str.[String.length str - 1] <> '\n' then str ^ "\n" e...
2017 Apr 12
0
[PATCH v6 07/10] dib: move do_cp to mllib.Commun_utils
...on_utils.mli | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dib/utils.ml b/dib/utils.ml index afa2ec944..2fe70e7fc 100644 --- a/dib/utils.ml +++ b/dib/utils.ml @@ -98,10 +98,6 @@ let get_required_tool tool = let require_tool tool = ignore (get_required_tool tool) -let do_cp src destdir = - let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in - if run_command cmd <> 0 then exit 1 - let ensure_trailing_newline str = if String.length str > 0 && str.[String.length str - 1] <> '\n' then str ^ "\n" e...
2017 Apr 25
1
Re: [PATCH v6 07/10] dib: move do_cp to mllib.Commun_utils
On Wednesday, 12 April 2017 14:33:09 CEST Cédric Bosdonnat wrote: > --- > dib/utils.ml | 4 ---- > mllib/common_utils.ml | 5 +++++ > mllib/common_utils.mli | 3 +++ > 3 files changed, 8 insertions(+), 4 deletions(-) It looks like virt-builder-repository does not use do_cp anymore, so this patch can be put aside for now. -- Pino Toscano
2017 Mar 07
0
[PATCH v4 8/9] mllib: add do_mv helper function to Common_utils
--- mllib/common_utils.ml | 6 ++++++ mllib/common_utils.mli | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 945728b5e..7932707c9 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -1172,3 +1172,9 @@ let do_cp src destdir = let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in if run_command cmd <> 0 then error (f_"copy of %s to %s failed") src destdir + +let do_mv src dest = + let cmd = [ "mv"; src; dest ] in + let r = run_command cmd in +...
2017 Mar 23
0
[PATCH v5 08/10] mllib: add do_mv helper function to Common_utils
--- mllib/common_utils.ml | 6 ++++++ mllib/common_utils.mli | 3 +++ 2 files changed, 9 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 945728b5e..7932707c9 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -1172,3 +1172,9 @@ let do_cp src destdir = let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in if run_command cmd <> 0 then error (f_"copy of %s to %s failed") src destdir + +let do_mv src dest = + let cmd = [ "mv"; src; dest ] in + let r = run_command cmd in +...
2017 Apr 12
0
[PATCH v6 08/10] mllib: add do_mv helper function to Common_utils
--- mllib/common_utils.ml | 6 ++++++ mllib/common_utils.mli | 3 +++ 2 files changed, 9 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index ceac57711..5cc865659 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -1191,3 +1191,9 @@ let do_cp src destdir = let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in if run_command cmd <> 0 then error (f_"copy of %s to %s failed") src destdir + +let do_mv src dest = + let cmd = [ "mv"; src; dest ] in + let r = run_command cmd in +...
2016 Aug 02
2
[PATCH] mllib: move which and its exception from dib
...+ mllib/common_utils.mli | 9 +++++++++ 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/dib/dib.ml b/dib/dib.ml index de4f242..87af4eb 100644 --- a/dib/dib.ml +++ b/dib/dib.ml @@ -297,7 +297,7 @@ $cmd \"$@\" (try let loc = which "dib-run-parts" in do_cp loc (destdir // "fake-bin") - with Tool_not_found _ -> + with Executable_not_found _ -> let fake_dib_run_parts = "\ #!/bin/sh echo \"Please install dib-run-parts on the host\" diff --git a/dib/utils.ml b/dib/utils.ml index f316264..a2046cb 100644 --- a/dib/ut...
2017 Mar 07
15
[PATCH v4 0/9] Introducing virt-builder-repository
...Cédric Bosdonnat (9): lib/osinfo.c: Extract xml processing into a callback lib: extract osinfo DB traversing API mllib: ocaml wrapper for lib/osinfo builder: rename docs test script builder: add Index_parser.write_entry function builder: add a template parameter to get_index dib: move do_cp to mllib.Commun_utils mllib: add do_mv helper function to Common_utils Add a virt-builder-repository tool .gitignore | 4 + builder/Makefile.am | 121 +++++- builder/builder.ml | 2 +- b...
2017 Mar 23
13
[PATCH v5 00/10] Introducing virt-builder-repository
...ino. Cédric Bosdonnat (10): lib/osinfo.c: Extract xml processing into a callback lib: extract osinfo DB traversing API mllib: ocaml wrapper for lib/osinfo builder: rename docs test script builder: add a template parameter to get_index builder: add Index.write_entry function dib: move do_cp to mllib.Commun_utils mllib: add do_mv helper function to Common_utils mllib: add XPath helper xpath_get_nodes() Add a virt-builder-repository tool .gitignore | 4 + builder/Makefile.am | 121 ++++- builder/builder.ml...
2017 Apr 12
12
[PATCH v6 00/10] Add a virt-builder-repository tool
...sion Cédric Bosdonnat (10): lib/osinfo.c: Extract xml processing into a callback lib: extract osinfo DB traversing API mllib: ocaml wrapper for lib/osinfo builder: rename docs test script builder: add a template parameter to get_index builder: add Index.write_entry function dib: move do_cp to mllib.Commun_utils mllib: add do_mv helper function to Common_utils mllib: add XPath helper xpath_get_nodes() Add a virt-builder-repository tool .gitignore | 4 + builder/Makefile.am | 124 ++++- builder/builder.ml...
2017 Mar 22
7
[PATCH 0/5] dib: initial work to support d-i-b 2.0
Hi, this series start to implement some of the changes needed to support d-i-b 2.0; normal VM distro builds seem to work correctly, ramdisk builds are still broken and require more efforts. Thanks, Pino Toscano (5): dib: implement get_image_element_array stuff dib: export IMAGE_BLOCK_DEVICE_WITHOUT_PART dib: extract get_required_tool out of require_tool dib: require a Python interpreter
2015 May 29
0
[PATCH v3] RFC: New virt-dib tool
..."$@\" +" in + write_script (destdir // "fake-bin" // "sudo") fake_sudo; + (* Pick dib-run-parts from the host, if available, otherwise put + * a fake executable which will error out if used. + *) + (try + let loc = which "dib-run-parts" in + do_cp loc (destdir // "fake-bin") + with Tool_not_found _ -> + let fake_dib_run_parts = "\ +#!/bin/sh +echo \"Please install dib-run-parts on the host\" +exit 1 +" in + write_script (destdir // "fake-bin" // "dib-run-parts") fake_dib_run_parts;...
2015 Jul 03
1
[PATCH v5] New tool: virt-dib
..."$@\" +" in + write_script (destdir // "fake-bin" // "sudo") fake_sudo; + (* Pick dib-run-parts from the host, if available, otherwise put + * a fake executable which will error out if used. + *) + (try + let loc = which "dib-run-parts" in + do_cp loc (destdir // "fake-bin") + with Tool_not_found _ -> + let fake_dib_run_parts = "\ +#!/bin/sh +echo \"Please install dib-run-parts on the host\" +exit 1 +" in + write_script (destdir // "fake-bin" // "dib-run-parts") fake_dib_run_parts;...
2015 Mar 31
0
[PATCH] WIP: New virt-dib tool
...ines = external_command ~prog (sprintf "which dib-run-parts") in + let lines = List.filter (fun x -> x <> "") lines in + let loc = + match lines with + | [] -> error (f_"empty output of `which dib-run-parts`") + | x :: _ -> x in + do_cp loc (destdir // "fake-bin") + ) else ( + let fake_dib_run_parts = "\ +#!/bin/sh +echo \"Please install dib-run-parts on the host\" +exit 1 +" in + write_script (destdir // "fake-bin" // "dib-run-parts") fake_dib_run_parts; + ); + + (* Write...
2015 Jun 16
2
[PATCH v4] RFC: New tool: virt-dib
..."$@\" +" in + write_script (destdir // "fake-bin" // "sudo") fake_sudo; + (* Pick dib-run-parts from the host, if available, otherwise put + * a fake executable which will error out if used. + *) + (try + let loc = which "dib-run-parts" in + do_cp loc (destdir // "fake-bin") + with Tool_not_found _ -> + let fake_dib_run_parts = "\ +#!/bin/sh +echo \"Please install dib-run-parts on the host\" +exit 1 +" in + write_script (destdir // "fake-bin" // "dib-run-parts") fake_dib_run_parts;...
2016 May 23
0
[PATCH 5/5] mllib: add a new run_command helper
...+109,14 @@ let which tool = | [] -> raise (Tool_not_found tool) | x :: _ -> x -let run_command cmd = - ignore (external_command cmd) - let require_tool tool = try ignore (which tool) with Tool_not_found tool -> error (f_"%s needed but not found") tool let do_cp src destdir = - run_command (sprintf "cp -t %s -a %s" (quote destdir) (quote src)) + let cmd = [| "cp"; "-t"; destdir; "-a"; src |] in + if run_command cmd <> 0 then exit 1 let ensure_trailing_newline str = if String.length str > 0 &&amp...
2017 Mar 07
0
[PATCH v4 9/9] Add a virt-builder-repository tool
...if id <> "" then + set := StringSet.add id !set + ); + g#close (); + osinfo_ids := Some (!set); + !set + ) + +let compress_to file outdir = + info "Copying image to temporary folder ...%!"; + let outimg = outdir // (Filename.basename file) in + do_cp file outdir; + + info "Compressing ...%!"; + let cmd = [ "xz"; "-f"; "--best"; + "--block-size=16777216"; outimg ] in + if run_command cmd <> 0 then + exit 1; + outimg ^ ".xz" + +let get_disk_image_info filepath =...
2017 Mar 23
0
[PATCH v5 10/10] Add a virt-builder-repository tool
...as_string node in + set := StringSet.add id !set + ) nodes + ); + g#close (); + osinfo_ids := Some (!set); + !set + ) + +let compress_to file outdir = + info "Copying image to temporary folder ...%!"; + let outimg = outdir // (Filename.basename file) in + do_cp file outdir; + + info "Compressing ...%!"; + let cmd = [ "xz"; "-f"; "--best"; + "--block-size=16777216"; outimg ] in + if run_command cmd <> 0 then + exit 1; + outimg ^ ".xz" + +let get_disk_image_info filepath =...
2016 May 23
7
[PATCH 1/5] mllib: make external_command echo the command executed
Add an optional parameter to disable this behaviour, so the Curl module in v2v won't print user-sensible data (like passwords). --- builder/checksums.ml | 1 - builder/downloader.ml | 1 - builder/sigchecker.ml | 1 - mllib/common_utils.ml | 4 +++- mllib/common_utils.mli | 7 +++++-- v2v/curl.ml | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git