search for: replace_char

Displaying 20 results from an estimated 46 matches for "replace_char".

2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...ix open Printf +open Common_utils open Types open Utils open Pr @@ -41,7 +42,7 @@ let deprecation_notice ?(prefix = "") ?(replace_underscores = false) = | { deprecated_by = None } -> None | { deprecated_by = Some alt } -> let alt = - if replace_underscores then replace_char alt '_' '-' else alt in + if replace_underscores then String.replace_char alt '_' '-' else alt in let txt = sprintf "I<This function is deprecated.> In new code, use the L</%s%s> call instead. diff --git a/generator/erlang.ml b/gene...
2016 Sep 02
6
[PATCH 0/4] generator: Some work to split large C files
By splitting up large C files we can make parallel compiles a bit faster. Rich.
2017 Oct 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...or/fish.ml @@ -53,7 +53,7 @@ let doc_opttype_of = function | OString n | OStringList n -> ".." -let get_aliases { fish_alias = fish_alias; non_c_aliases = non_c_aliases } = +let get_aliases { fish_alias; non_c_aliases } = let non_c_aliases = List.map (fun n -> String.replace_char n '_' '-') non_c_aliases in fish_alias @ non_c_aliases @@ -61,7 +61,7 @@ let get_aliases { fish_alias = fish_alias; non_c_aliases = non_c_aliases } = let all_functions_commands_and_aliases_sorted = let all = List.fold_right ( - fun ({ name = name; shortdesc = shortd...
2016 Dec 18
0
[PATCH v4 4/6] mllib: modify nsplit to take optional noempty and count arguments
...:noempty ~count:count sep s'' ) let split sep str = diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 4a6ddd6..fd0ef49 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -80,9 +80,17 @@ module String : sig [str] with [s2]. *) val replace_char : string -> char -> char -> string (** Replace character in string. *) - val nsplit : string -> string -> string list + val nsplit : ?noempty:bool -> ?count:int -> string -> string -> string list (** [nsplit sep str] splits [str] into multiple strings at e...
2016 Dec 09
0
Re: [PATCH] generator: Share Common_utils code.
...tions = > > let failwithf fs = ksprintf failwith fs > > -let unique = let i = ref 0 in fun () -> incr i; !i This seems to be used only in generator, so I'd leave it here for now (reduces the changes in this patch, and it can always be moved later on when needed). > -let replace_char s c1 c2 = > - let b2 = Bytes.of_string s in > - let r = ref false in > - for i = 0 to Bytes.length b2 - 1 do > - if Bytes.unsafe_get b2 i = c1 then ( > - Bytes.unsafe_set b2 i c2; > - r := true > - ) > - done; > - if not !r then s else Bytes.to_string...
2014 Sep 20
3
[PATCH v2 0/3] tests: Introduce test harness for running tests.
This has got to the stage where it actually works, both for running the tests in-tree and installed. The 'test-harness' script has become rather over-complex in the process however. Rich.
2017 Jan 30
0
[PATCH v6 2/3] mllib: modify nsplit to take optional noempty and count arguments
...mpty ~count:count sep s'' ) let split sep str = diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 722e528e5..5494c018c 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -80,9 +80,17 @@ module String : sig [str] with [s2]. *) val replace_char : string -> char -> char -> string (** Replace character in string. *) - val nsplit : string -> string -> string list + val nsplit : ?keep_empty:bool -> ?count:int -> string -> string -> string list (** [nsplit sep str] splits [str] into multiple strings a...
2023 Mar 16
3
[V2V PATCH v4 0/2] convert_windows: add firstboot script to install drivers with pnputil
While messing around this script, I added one more tiny patch making wait-pnp log its output into the common log.txt file, as suggested by Richard here: https://listman.redhat.com/archives/libguestfs/2023-March/031023.html Discussion on v3: https://listman.redhat.com/archives/libguestfs/2023-March/031070.html v3 -> v4: * Remove unneeded line break from the script; * Add another small
2017 Oct 04
11
[PATCH 0/9] build: Require OCaml >= 4.02.
Per my previous email: https://www.redhat.com/archives/libguestfs/2017-September/msg00203.html I'd like to talk about requiring a more modern version of the OCaml compiler. These commits show some of the code changes which would be possible with OCaml >= 3.12 [which it turns out we already require by accident] and also with OCaml >= 4.02. The latter is my favoured option. Rich.
2012 Oct 30
5
[PATCH v3 0/5] Add symbol versioning.
This is a simpler patch series to add symbol versioning. I have pushed patches 1-3 upstream. Rich.
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
...un = run_%s\n" name; pr "};\n"; pr "\n"; - ) all_functions; + ) fish_functions; (* list_commands function, which implements guestfish -h *) pr "void\n"; @@ -187,7 +183,7 @@ Guestfish will prompt for these separately." let name = replace_char name '_' '-' in pr " printf (\"%%-20s %%s\\n\", \"%s\", _(\"%s\"));\n" name shortdesc - ) all_functions_and_fish_commands_sorted; + ) fish_functions_and_commands_sorted; pr " printf (\" %%s\\n\",";...
2017 Jul 31
0
[PATCH v11 09/10] daemon: Implement inspection of Windows.
..._group 4 line) + and part = int_of_string (Str.matched_group 5 line) + and path = Str.matched_group 6 line in + + (* Swap backslashes for forward slashes in the + * system root path. + *) + let path = String.replace_char path '\\' '/' in + + Some (ctrlr_type, ctrlr, disk, rdisk, part, path) + ) + else None + ) oses in + + (* The Windows system root may be on any disk. However, there + * are currently (at least) 2 practical problems pre...
2018 Dec 04
2
[PATCH FOR DISCUSSION ONLY 0/2] v2v: Copy static IP address information over for Windows guests (RHBZ#1626503).
This patch is just for discussion. There are still a couple of issues that I'm trying to fix. One is that all of the test guests I have, even ones with static IPs, have multiple interfaces, some using DHCP, so the conditions for adding the Powershell script don't kick in. This makes testing very awkward. However a bigger issue is that I think the premise is wrong. In some registries
2012 Oct 30
7
[PATCH v2 0/7] Add symbol versioning (now working).
This rather more complex patch series adds symbol versioning (7/7 shows it in action). This works for me, tested by running old and new virt-inspector binaries against the new library. Rich.
2012 Jul 14
6
[PATCH 0/6] Allow non-optargs functions to gain optional arguments.
This rather complex set of patches allow non-optargs functions to gain optional arguments, while preserving source and binary backwards compatibility. The problem is that we cannot add an optional argument to an existing function. For example, we might want to add flags to the 'lvresize' API which currently has no optional arguments.
2016 Jun 15
3
[PATCH 2/3] Convert source so it can be compiled with OCaml '-safe-string' option.
OCaml 4.02 introduced the 'bytes' type, a mutable string intended to replace the existing 'string' type for those cases where the byte array can be mutated. In future the 'string' type will become immutable. This is not the default now, but it can be forced using the '-safe-string' compile option. I tested this on Fedora 24 (OCaml 4.02) & RHEL 7 (OCaml 4.01).
2018 Dec 11
2
[PATCH v2 2/2] v2v: Copy static IP address information over for Windows guests (RHBZ#1626503).
v1 was here with much discussion: https://www.redhat.com/archives/libguestfs/2018-December/msg00048.html v2: - Fix the case where there are multiple interfaces. Note this does not preserve order correctly (see patch for comment on why that is a hard problem). - Preserve name servers. This patch is still for discussion only. I'd like to see what might be done to get this upstream
2014 Oct 03
0
[PATCH v3] tests: Introduce test harness for running tests.
...) in + + if clean_up_tmpdir then + ignore (Sys.command (sprintf "rm -rf %s" (Filename.quote tmpdir))); + + results + ) + + (* Convert a test name like 'test-network.sh' into 'SKIP_TEST_NETWORK_SH'. *) + and skip_name name = + let skip = Utils.replace_char name '-' '_' in + let skip = Utils.replace_char skip '.' '_' in + let skip = "SKIP_" ^ String.uppercase skip in + skip + in + + (* Make the phony guests? *) + if make_phony_guests_only || normal || slow then ( + make_phony_guests (); + if...
2014 Sep 16
5
[PATCH 0/3] tests: Introduce test harness for running tests.
These are my thoughts on adding a test harness to run tests instead of using automake. The aim of this exercise is to allow us to run the full test suite on an installed copy of libguestfs. Another aim is to allow us to work around all the limitations and problems of automake. The first patch makes an observation that since the ./run script sets up $PATH to contain all the directories
2014 Oct 05
0
[PATCH v5 1/7] tests: Introduce test harness for running tests.
...builddir () in + let cmd = sprintf "%s/pick-guests.pl 5" top_builddir in + let guests = get_lines cmd in + run_one_test dir test guests + + (* Convert a test name like 'test-network.sh' into 'SKIP_TEST_NETWORK_SH'. *) + and skip_name name = + let skip = Utils.replace_char name '-' '_' in + let skip = Utils.replace_char skip '.' '_' in + let skip = "SKIP_" ^ String.uppercase skip in + skip + in + + (* Make the phony guests? *) + if make_phony_guests_only || normal || slow then ( + make_phony_guests (); + if...