Displaying 16 results from an estimated 16 matches for "digit_prefix_compar".
Did you mean:
digit_prefix_compare
2016 Sep 23
2
[PATCH 1/2] mllib: move remove_duplicates from v2v
Simple code motion.
---
mllib/common_utils.ml | 9 +++++++++
mllib/common_utils.mli | 6 ++++++
v2v/utils.ml | 9 ---------
v2v/utils.mli | 3 ---
4 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 81d8202..78618f5 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -297,6 +297,15 @@ let sort_uniq
2016 Sep 23
0
[PATCH 2/2] dib: use remove_duplicates instead of own code
...t "," arg) in
List.iter (
function
| "qcow2" | "tar" | "raw" | "vhd" | "docker" -> ()
diff --git a/dib/utils.ml b/dib/utils.ml
index a2046cb..3df5171 100644
--- a/dib/utils.ml
+++ b/dib/utils.ml
@@ -91,10 +91,6 @@ let digit_prefix_compare a b =
let do_mkdir dir =
mkdir_p dir 0o755
-let rec remove_dups = function
- | [] -> []
- | x :: xs -> x :: (remove_dups (List.filter ((<>) x) xs))
-
let require_tool tool =
try ignore (which tool)
with Executable_not_found tool ->
--
2.7.4
2017 Feb 21
0
[PATCH 3/3] dib: rename "aux" to "in_target.aux"
...et timed_run fn =
let run_parts ~debug ~sysroot ~blockdev ~log_file ?(new_wd = "")
(g : Guestfs.guestfs) hook_name scripts =
- let hook_dir = "/tmp/aux/hooks/" ^ hook_name in
+ let hook_dir = "/tmp/in_target.aux/hooks/" ^ hook_name in
let scripts = List.sort digit_prefix_compare scripts in
let outbuf = Buffer.create 16384 in
let timings = Hashtbl.create 13 in
@@ -393,11 +393,11 @@ let run_parts ~debug ~sysroot ~blockdev ~log_file ?(new_wd = "")
let outstr =
match sysroot with
| In ->
- g#sh (sprintf "/tmp/a...
2016 Aug 03
0
[PATCH] dib: rework run of extra-data.d hooks (RHBZ#1362354)
...ot;")
flush_all ();
Buffer.contents outbuf
-let run_parts_host ~debug hooks_dir hook_name scripts run_script =
+let run_parts_host ~debug (g : Guestfs.guestfs) hooks_dir hook_name base_mount_dir scripts run_script =
let hook_dir = hooks_dir // hook_name in
let scripts = List.sort digit_prefix_compare scripts in
- let timings = Hashtbl.create 13 in
- List.iter (
- fun x ->
- message (f_"Running: %s/%s") hook_name x;
- let cmd = [ run_script; hook_dir; x ] in
- let run () =
- run_command cmd in
- let delta_t = timed_run run in
- if debug >= 1...
2017 Feb 21
3
[PATCH 1/3] dib: unset all temporary dirs envvars in fake-sudo
The real sudo does it as well, and leaving them when preserving the
environment (-E) maybe breaks the applications, as e.g. chroot will have
a TMPDIR path pointing outside of it.
---
dib/dib.ml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dib/dib.ml b/dib/dib.ml
index df83ba1..d15cd19 100644
--- a/dib/dib.ml
+++ b/dib/dib.ml
@@ -301,6 +301,11 @@ if [ -z \"$preserve_env\" ];
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
2016 Aug 03
3
[PATCH] mllib: move _exit from v2v as Exit module
Move the OCaml binding to C _exit to an own module.
Just code motion, adapting v2v in the process.
---
docs/C_SOURCE_FILES | 2 +-
mllib/Makefile.am | 5 ++++-
mllib/exit-c.c | 33 +++++++++++++++++++++++++++++++++
mllib/exit.ml | 19 +++++++++++++++++++
mllib/exit.mli | 20 ++++++++++++++++++++
v2v/Makefile.am | 1 -
v2v/changeuid-c.c | 33
2015 May 29
0
[PATCH v3] RFC: New virt-dib tool
...() in
+ fn ();
+ let time_after = Unix.gettimeofday () in
+ time_after -. time_before
+
+let run_parts ~debug ~sysroot ~blockdev ~log_file ?(new_wd = "")
+ (g : Guestfs.guestfs) hook_name scripts =
+ let hook_dir = "/tmp/aux/hooks/" ^ hook_name in
+ let scripts = List.sort digit_prefix_compare scripts in
+ let outbuf = Buffer.create 16384 in
+ let timings = Hashtbl.create 13 in
+ let new_wd =
+ match sysroot, new_wd with
+ | (Out|Subroot), "" -> "''"
+ | _, dir -> dir in
+ List.iter (
+ fun x ->
+ message (f_"Running: %s/%s&...
2015 Jul 03
1
[PATCH v5] New tool: virt-dib
...() in
+ fn ();
+ let time_after = Unix.gettimeofday () in
+ time_after -. time_before
+
+let run_parts ~debug ~sysroot ~blockdev ~log_file ?(new_wd = "")
+ (g : Guestfs.guestfs) hook_name scripts =
+ let hook_dir = "/tmp/aux/hooks/" ^ hook_name in
+ let scripts = List.sort digit_prefix_compare scripts in
+ let outbuf = Buffer.create 16384 in
+ let timings = Hashtbl.create 13 in
+ let new_wd =
+ match sysroot, new_wd with
+ | (Out|Subroot), "" -> "''"
+ | _, dir -> dir in
+ List.iter (
+ fun x ->
+ message (f_"Running: %s/%s&...
2015 Mar 31
0
[PATCH] WIP: New virt-dib tool
...ntries = List.filter (fun x -> is_string_valid x) entries in
+ let entries = List.filter (
+ fun x ->
+ let fn = hook_dir ^ "/" ^ x in
+ ((g#stat fn).G.mode &^ 0o111_L > 0_L) && g#is_file ~followsymlinks:true fn
+ ) entries in
+ let entries = List.sort digit_prefix_compare entries in
+ let outbuf = Buffer.create 16384 in
+ if dryrun then (
+ List.iter (fun x -> msg (f_"Would run: %s/%s") hook_name x) entries
+ ) else (
+ let timings = Hashtbl.create 13 in
+ let new_wd =
+ match sysroot, new_wd with
+ | (Out|Subroot), "" -...
2015 Jun 16
2
[PATCH v4] RFC: New tool: virt-dib
...() in
+ fn ();
+ let time_after = Unix.gettimeofday () in
+ time_after -. time_before
+
+let run_parts ~debug ~sysroot ~blockdev ~log_file ?(new_wd = "")
+ (g : Guestfs.guestfs) hook_name scripts =
+ let hook_dir = "/tmp/aux/hooks/" ^ hook_name in
+ let scripts = List.sort digit_prefix_compare scripts in
+ let outbuf = Buffer.create 16384 in
+ let timings = Hashtbl.create 13 in
+ let new_wd =
+ match sysroot, new_wd with
+ | (Out|Subroot), "" -> "''"
+ | _, dir -> dir in
+ List.iter (
+ fun x ->
+ message (f_"Running: %s/%s&...
2017 Feb 14
14
[PATCH 00/10] dib/API: improvements and fixes
Hi,
this patch series does changes mostly in virt-dib, few bug fixes and
a couple of new features (mostly implemented upstream already).
In addition, one new API is added, and a new optional argument for an
existing API is added (the latter is not needed, but could be useful
anyway).
Thanks,
Pino Toscano (10):
dib: fix listing envvars in fake-sudo
dib: source dib "die" script in
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...ils.mli
/generator/files-generated.txt
/generator/generator
+/generator/guestfs_config.ml
/generator/.pod2text.data*
/generator/stamp-generator
/get-kernel/.depend
diff --git a/dib/utils.ml b/dib/utils.ml
index 3df5171..4026ee8 100644
--- a/dib/utils.ml
+++ b/dib/utils.ml
@@ -74,7 +74,7 @@ let digit_prefix_compare a b =
let split_prefix str =
let len = String.length str in
let digits =
- try string_index_fn (fun x -> not (isdigit x)) str
+ try string_index_fn (fun x -> not (Char.isdigit x)) str
with Not_found -> len in
match digits with
| 0 -> ""...
2017 Sep 20
8
[PATCH v2 0/6] Fix OCaml dependencies.
v1 -> v2:
- Fixed everything mentioned in patch review.
- Libdir module is removed as a separate commit.
Rich.
2017 Sep 18
0
[PATCH 2/5] Make sure every *.ml file has a corresponding *.mli file.
...riable definition in a set of lines of the form [var=value]. *)
+
+val string_index_fn : (char -> bool) -> string -> int
+(** Apply function to each character in the string. If the function
+ returns true, return the index of the character.
+
+ @raise Not_found if no match *)
+
+val digit_prefix_compare : string -> string -> int
+
+val do_mkdir : string -> unit
+(** Wrapper around [mkdir -p] *)
+
+val get_required_tool : string -> string
+(** Ensure external program is installed. Return the full path of the
+ program or fail with an error message. *)
+
+val require_tool : string -...
2017 Sep 18
6
[PATCH 0/5] Fix OCaml dependencies.
This works reliably for me ...
Rich.