search for: string_nsplit

Displaying 20 results from an estimated 33 matches for "string_nsplit".

2015 Oct 06
0
[PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*
...d hoc string_* functions that appeared in Common_utils have been renamed and placed in the String.* namespace. The old vs "new" functions are: string_prefix -> String.is_prefix string_suffix -> String.is_suffix string_find -> String.find replace_str -> String.replace string_nsplit -> String.nsplit string_split -> String.split string_lines_split -> String.lines_split string_random8 -> String.random8 --- builder/checksums.ml | 2 +- builder/downloader.ml | 2 +- builder/index_parser.ml | 4 +- bui...
2015 May 11
3
[PATCH 1/3] builder: move gpg status parsing within import_keyfile
...port_keyfile ~gpg ~gpghome ~verbose keyfile = let r = Sys.command cmd in if r <> 0 then error (f_"could not import public key\nUse the '-v' option and look for earlier error messages."); - status_file + let status = read_whole_file status_file in + let status = string_nsplit "\n" status in + let fingerprint = ref "" in + List.iter ( + fun line -> + let line = string_nsplit " " line in + match line with + | "[GNUPG:]" :: "IMPORT_OK" :: _ :: fp :: _ -> fingerprint := fp + | _ -> () + ) s...
2015 Oct 06
10
[PATCH 0/5] mllib: Hide bad String functions and miscellaneous refactoring.
Hide/prevent the use of bad string functions like String.lowercase. These are replaced by safe functions that won't break UTF-8 strings. Other miscellaneous refactoring. Rich.
2013 Aug 16
3
[PATCH v2] sysprep: added --mount-options option to mount selected
Nikita, Please take a look at the attached patch. I have rewritten it a little, and only lightly tested it. Rich.
2015 Oct 07
1
Re: [PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*
...red in Common_utils have been renamed and placed > in the String.* namespace. The old vs "new" functions are: > > string_prefix -> String.is_prefix > string_suffix -> String.is_suffix > string_find -> String.find > replace_str -> String.replace > string_nsplit -> String.nsplit > string_split -> String.split > string_lines_split -> String.lines_split > string_random8 -> String.random8 > --- As mentioned yesterday on IRC, I'm torn about this one: the functions would automatically alias functions with the same name, whenever...
2015 Jan 20
2
Re: [PATCH] v2v: -o vdsm should assume data domain at -os path
...gt; > > What is the significance of 36 here? > > the length of uuid. > > That code above will throw an exception if you pass a too-short -os > parameter. > > How about this, which should be a little bit easier to understand: > > let mp, uuid = > let fields = string_nsplit "/" os in (* ... "data-center" "UUID" *) > let fields = List.rev fields in (* "UUID" "data-center" ... *) > match fields with > | "" :: uuid :: rest (* handles trailing "/" case *) > | uui...
2015 Jan 26
2
Re: [PATCH] v2v: -o vdsm should assume data domain at -os path
...gt; * the next time we are called (in {!create_metadata}) we have already > @@ -79,7 +78,18 @@ object > (List.length targets); > > let mp, uuid = > - Output_rhev.mount_and_check_storage_domain verbose (s_"Data Domain") os in > + let fields = string_nsplit "/" os in (* ... "data-center" "UUID" *) > + let fields = List.rev fields in (* "UUID" "data-center" ... *) > + match fields with > + | "" :: uuid :: rest (* handles trailing "/" case...
2015 Jan 20
3
Re: [PATCH] v2v: -o vdsm should assume data domain at -os path
On 20.01.15 12:59, Richard W.M. Jones wrote: > On Tue, Jan 20, 2015 at 02:53:43PM +0200, Shahar Havivi wrote: > > > >From 87f448fc8b3243ad5d01acb65efb0c710d811a93 Mon Sep 17 00:00:00 2001 > > From: Shahar Havivi <shaharh@redhat.com> > > Date: Tue, 20 Jan 2015 14:41:23 +0200 > > Subject: [PATCH] v2v: -o vdsm should assume data domain at -os path > >
2014 May 26
2
[PATCH] builder: support aliases for images (RHBZ#1098718).
...13 @@ let get_index ~prog ~debug ~downloader ~sigchecker ~proxy source = eprintf (f_"virt-builder: cannot parse 'hidden' field for '%s'\n") n; corrupt_file () in + let aliases = + let l = + try string_nsplit list_separator (List.assoc ("aliases", None) fields) + with Not_found -> [] in + match l with + | [] -> None + | l -> Some l in let entry = { printable_name = printable_name; osinfo = osinfo; @@ -...
2015 Jan 20
0
Re: [PATCH] v2v: -o vdsm should assume data domain at -os path
...let uuid = String.sub os pos 36 in > > > > What is the significance of 36 here? > the length of uuid. That code above will throw an exception if you pass a too-short -os parameter. How about this, which should be a little bit easier to understand: let mp, uuid = let fields = string_nsplit "/" os in (* ... "data-center" "UUID" *) let fields = List.rev fields in (* "UUID" "data-center" ... *) match fields with | "" :: uuid :: rest (* handles trailing "/" case *) | uuid :: rest when...
2015 Jul 28
0
[PATCH 05/10] builder: allow signatures from subkeys
...ngerprint --with-fingerprint --list-keys %s" + gpg gpghome !fingerprint in + if verbose () then printf "%s\n%!" cmd; + let lines = external_command cmd in + let current = ref None in + let subkeys = ref [] in + List.iter ( + fun line -> + let line = string_nsplit ":" line in + match line with + | "sub" :: ("u"|"-") :: _ :: _ :: id :: _ -> + current := Some id + | "fpr" :: _ :: _ :: _ :: _ :: _ :: _ :: _ :: _ :: id :: _ -> + (match !current with + | None -...
2014 Aug 21
2
Re: [PATCH] v2v: adding input -i ova
...ssible to test this without carrying around huge/proprietary files. > + (* verify sha1 from manifest file *) > + let mf = dir // !mf in > + let rex = Str.regexp "SHA1(\\(.*\\))= *\\(.*?\\).*$" in > + let lines = read_whole_file mf in In here, add: let lines = string_nsplit "\n" lines in and replace the (Str.split ... lines) with just lines (after List.iter). > + List.iter ( > + fun line -> > + if Str.string_match rex line 0 then > + let file = Str.matched_group 1 line in > + let sha1 = Str.matched_grou...
2014 Feb 21
2
[PATCH] builder: add an arch field to sources read from indexes
...e_cmdline () = let display_version () = @@ -408,18 +410,18 @@ read the man page virt-builder(1). ) in (* Check source(s) and fingerprint(s), or use environment or default. *) - let sources = + let sources, indexarch = let list_split = function "" -> [] | str -> string_nsplit "," str in let rec repeat x = function | 0 -> [] | 1 -> [x] | n -> x :: repeat x (n-1) in - let sources = - if sources <> [] then sources + let sources, indexarch = + if sources <> [] then sources, "@same" els...
2015 Jul 17
0
[PATCH 2/2] customize: add basic subscription-manager operations
...or, Boston, MA 02110-1301 USA. + *) + +open Common_gettext.Gettext +open Common_utils + +type sm_credentials = { + sm_username : string; + sm_password : string; +} + +type sm_pool = +| PoolAuto +| PoolId of string + +let rec parse_credentials_selector arg = + parse_credentials_selector_list arg (string_nsplit ":" arg) + +and parse_credentials_selector_list orig_arg = function + | [ username; "password"; password ] -> + { sm_username = username; sm_password = password } + | [ username; "file"; filename ] -> + { sm_username = username; sm_password = read_first_l...
2015 Jan 26
1
[PATCH] v2v: -o vdsm should assume data domain at -os path
...if there are any problems, since * the next time we are called (in {!create_metadata}) we have already @@ -79,7 +78,18 @@ object (List.length targets); let mp, uuid = - Output_rhev.mount_and_check_storage_domain verbose (s_"Data Domain") os in + let fields = string_nsplit "/" os in (* ... "data-center" "UUID" *) + let fields = List.rev fields in (* "UUID" "data-center" ... *) + match fields with + | "" :: uuid :: rest (* handles trailing "/" case *) + | uui...
2015 Jan 26
0
Re: [PATCH] v2v: -o vdsm should assume data domain at -os path
...called (in {!create_metadata}) we have already > > @@ -79,7 +78,18 @@ object > > (List.length targets); > > > > let mp, uuid = > > - Output_rhev.mount_and_check_storage_domain verbose (s_"Data Domain") os in > > + let fields = string_nsplit "/" os in (* ... "data-center" "UUID" *) > > + let fields = List.rev fields in (* "UUID" "data-center" ... *) > > + match fields with > > + | "" :: uuid :: rest (* handles trailing &quo...
2015 Jul 17
4
[PATCH v2 0/2] basic subscription-manager support in virt-customize
Hi, this is the v2 of a series introducing basic support for registering/attaching/unregistering RHEL guests using subscription-manager, so it is possible to do for example: $ virt-customize -a rhel-guest.qcow2 \ --sm-credentials user:file:/path/to/password-file --sm-register \ --sm-attach file:/path/to/pool-file \ --install pkg1 --install pkg2 .. \ --sm-remove --sm-unregister
2014 Dec 04
2
[PATCH v3 0/2] v2v: When picking a default kernel, favour non-debug
Since v2: - Use string_suffix kernel_name "-debug" || string_suffix kernel_name "-dbg" - This requires addition of the string_suffix function and some tests
2014 Jan 13
2
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
On Friday 10 January 2014 10:09:19 Richard W.M. Jones wrote: > On Thu, Jan 09, 2014 at 03:45:54PM +0000, Richard W.M. Jones wrote: > > On Thu, Jan 09, 2014 at 04:21:10PM +0100, Pino Toscano wrote: > > > + and set_operations op_string = > > > + let currentopset = > > > + match (!operations) with > > > > No need for parentheses around
2015 Jul 03
1
[PATCH v5] New tool: virt-dib
...ze := parse_size arg in + + let memsize = ref None in + let set_memsize arg = memsize := Some arg in + + let network = ref true in + + let smp = ref None in + let set_smp arg = smp := Some arg in + + let formats = ref ["qcow2"] in + let set_format arg = + let fmts = remove_dups (string_nsplit "," arg) in + List.iter ( + function + | "qcow2" | "tar" | "raw" | "vhd" -> () + | fmt -> + error (f_"invalid format '%s' in --formats") fmt + ) fmts; + formats := fmts in + + let envvars = ref...