search for: global_replace

Displaying 20 results from an estimated 26 matches for "global_replace".

2016 Aug 06
1
[PATCH] v2v: fix regex replacement in grub2_update_console
....4b1ce99 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -1057,9 +1057,9 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps = if Str.string_match rex grub_cmdline 0 then ( let new_grub_cmdline = if not remove then - Str.global_replace rex "\\1console=ttyS0\\3" grub_cmdline + Str.global_replace rex "\\1console=ttyS0\\2" grub_cmdline else - Str.global_replace rex "\\1\\3" grub_cmdline in + Str.global_replace rex "\\1\\2" grub_cmdline in g#...
2019 Aug 10
0
[PATCH libnbd 1/5] python: Change aio_buffer into nbd.Buffer class.
...args @ List.map (fun (n, def) -> n ^ "=" ^ def) optargs in - let params = List.map ((^) ", ") params in - let params = String.concat "" params in - pr " def %s (self%s):\n" name params in - let () = - let longdesc = Str.global_replace py_fn_rex "C<nbd." longdesc in - let longdesc = Str.global_replace py_const_rex "C<" longdesc in - let longdesc = pod2text longdesc in - pr " '''▶ %s\n\n%s'''\n" - shortdesc (String.concat "\n&quo...
2019 Aug 10
7
[PATCH libnbd 0/5] WIP: python: Add test for doing asynch copy.
This doesn't yet work. However it does make me more convinced than ever that we really need to sort out persistent buffer lifetimes in the library (similar to what we did for closures). Rich.
2016 Aug 15
2
[PATCH v2] v2v: factor out bootloader handling
...intf "/files%s/title/kernel/console" grub_config in + + let paths = g#aug_match expr in + let paths = Array.to_list paths in + List.iter ( + fun path -> + let console = g#aug_get path in + if Str.string_match rex console 0 then ( + let console = Str.global_replace rex "\\1ttyS0\\3" console in + g#aug_set path console + ) + ) paths; + + g#aug_save () + + method remove_console () = + let rex = Str.regexp "\\(.*\\)\\b\\([xh]vc0\\)\\b\\(.*\\)" in + let expr = sprintf "/files%s/title/kernel/console" grub_...
2015 Nov 20
0
[PATCH] v2v: factor out bootloader handling
...intf "/files%s/title/kernel/console" grub_config in + + let paths = g#aug_match expr in + let paths = Array.to_list paths in + List.iter ( + fun path -> + let console = g#aug_get path in + if Str.string_match rex console 0 then ( + let console = Str.global_replace rex "\\1ttyS0\\3" console in + g#aug_set path console + ) + ) paths; + + g#aug_save () + + method remove_console () = + let rex = Str.regexp "\\(.*\\)\\b\\([xh]vc0\\)\\b\\(.*\\)" in + let expr = sprintf "/files%s/title/kernel/console" grub_...
2016 Aug 15
0
Re: [PATCH v2] v2v: factor out bootloader handling
..." grub_config in > + > + let paths = g#aug_match expr in > + let paths = Array.to_list paths in > + List.iter ( > + fun path -> > + let console = g#aug_get path in > + if Str.string_match rex console 0 then ( > + let console = Str.global_replace rex "\\1ttyS0\\3" console in > + g#aug_set path console > + ) > + ) paths; > + > + g#aug_save () > + > + method remove_console () = > + let rex = Str.regexp "\\(.*\\)\\b\\([xh]vc0\\)\\b\\(.*\\)" in > + let expr = sprintf &q...
2016 Aug 25
2
[PATCH v2] v2v: factor out bootloader handling
...les%s/title/kernel/console" grub_config in - - let paths = g#aug_match expr in - let paths = Array.to_list paths in - List.iter ( - fun path -> - let console = g#aug_get path in - if Str.string_match rex console 0 then ( - let console = Str.global_replace rex "\\1ttyS0\\3" console in - g#aug_set path console - ) - ) paths; - - g#aug_save () - - | `Grub2 -> - grub2_update_console ~remove:false - (* If the target doesn't support a serial console, we want to remove * all references to it ins...
2017 Sep 22
0
[PATCH v3 18/22] v2v: vCenter: Replace Str with PCRE.
...; let default_dc = "ha-datacenter" let guess_dcPath uri = function @@ -136,7 +136,7 @@ let guess_dcPath uri = function * remove the Cluster name (which still works in libvirt). *) (* Collapse multiple slashes to single slash. *) - let path = Str.global_replace multiple_slash "/" path in + let path = PCRE.replace ~global:true multiple_slash "/" path in (* Chop off the first and trailing '/' (if found). *) let path = let len = String.length path in @@ -158,14 +158,13 @@ let guess_dcPath ur...
2017 Feb 07
0
[PATCH v2 5/7] builder: add Index.write_entry function
...=%s\n") format; + fp "size=%Ld\n" size; + may (fp "compressed_size=%Ld\n") compressed_size; + may (fp "expand=%s\n") expand; + may (fp "lvexpand=%s\n") lvexpand; + List.iter ( + fun (lang, notes) -> + let format_notes notes = + Str.global_replace (Str.regexp "^" ) " " notes in + match lang with + | "" -> fp "notes=%s\n" (format_notes notes) + | lang -> fp "notes[%s]=%s\n" lang (format_notes notes) + ) notes; + (match aliases with + | None -> () + | Some l -> fp...
2017 Feb 10
0
[PATCH v3 08/10] builder: add Index.write_entry function
...=%s\n") format; + fp "size=%Ld\n" size; + may (fp "compressed_size=%Ld\n") compressed_size; + may (fp "expand=%s\n") expand; + may (fp "lvexpand=%s\n") lvexpand; + List.iter ( + fun (lang, notes) -> + let format_notes notes = + Str.global_replace (Str.regexp "^" ) " " notes in + match lang with + | "" -> fp "notes=%s\n" (format_notes notes) + | lang -> fp "notes[%s]=%s\n" lang (format_notes notes) + ) notes; + (match aliases with + | None -> () + | Some l -> fp...
2017 Sep 21
18
[PATCH v2 00/18] Replace many more uses of the Str module with PCRE.
v1 was here: https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html This is a more complete evolution of the earlier patch. It replaces most important uses of Str with PCRE throughout the code. It also extends the bindings with some useful features like case-insensitive regexps. The main places I *didn't* touch are the generator (GObject uses Str extensively); and
2017 Sep 22
27
[PATCH v3 00/22] Replace almost all uses of the Str module with PCRE.
v1: https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html v2: https://www.redhat.com/archives/libguestfs/2017-September/msg00158.html v3 is almost identical to v2, but I have added 4 extra commits to almost finish the job of replacing Str everywhere possible (note it's not possible to replace Str in common/mlstdutils or the generator because those are pure OCaml). As
2017 Mar 07
0
[PATCH v4 5/9] builder: add Index_parser.write_entry function
...format; + fp "size=%Ld\n" size; + may (fp "compressed_size=%Ld\n") compressed_size; + may (fp "expand=%s\n") expand; + may (fp "lvexpand=%s\n") lvexpand; + List.iter ( + fun (lang, notes) -> + let format_notes notes = + String.trim (Str.global_replace (Str.regexp "^\\([^ ]\\)" ) " \\1" notes) in + match lang with + | "" -> fp "notes=%s\n" (format_notes notes) + | lang -> fp "notes[%s]=%s\n" lang (format_notes notes) + ) notes; + (match aliases with + | None -> () + | S...
2015 Oct 09
4
[PATCH 0/4] v2v: Use libvirt-supplied <vmware:datacenterpath> if available.
See earlier thread on libvir-list: https://www.redhat.com/archives/libvir-list/2015-September/thread.html#00201 Libvirt >= 1.2.20 supplies the correct dcPath parameter. If it is available in the libvirt XML, use it, otherwise fall back to the old method of trying to guess it from the vpx:// path. Patches 1, 2 and 4 are just refactoring around this change. Rich.
2012 Apr 26
1
[PATCH] gobject: Move headers into a subdirectory
...+++ b/generator/generator_gobject.ml @@ -126,7 +126,7 @@ let output_filenames = ) let output_header filename f = - let header = sprintf "gobject/guestfs-gobject-%s.h" filename in + let header = sprintf "gobject/include/guestfs-gobject/%s.h" filename in let guard = Str.global_replace (Str.regexp "-") "_" filename in let guard = "GUESTFS_GOBJECT_" ^ String.uppercase guard ^ "_H__" in output_to header (fun () -> @@ -152,15 +152,14 @@ G_END_DECLS ) let output_source filename ?(title=None) ?(shortdesc=None) ?(longdesc=None) f =...
2023 Oct 10
5
[PATCH libnbd 0/4] Miscellaneous Rust cleanups
Add an overview libnbd-rust(3) man page pointing to the real documentation. This is like OCaml & Golang. When reviewing the real rustdocs I noticed they basically converted the man pages into plain text, resulting in lots of problems such as internal links not working, no `code` annotations, etc. So I wrote a simple POD to rustdoc translator. It is by no means perfect, but it fixes many of
2015 Feb 27
5
[PATCH 0/4] firstboot: assorted enhancements
This patchset attempts to address a number of shortcomings in the firstboot infrastructure I came across while working with v2v conversion of various Windows VMs. Roman Kagan (4): firstboot: consolidate line ending conversion firstboot: enhance firstboot driver script for Windows firstboot: make script naming descriptive convert_windows: split firstboot into steps
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...args @ List.map (fun (n, def) -> n ^ "=" ^ def) optargs in + let params = List.map ((^) ", ") params in + let params = String.concat "" params in + pr " def %s (self%s):\n" name params in let () = let longdesc = Str.global_replace py_fn_rex "C<nbd." longdesc in let longdesc = Str.global_replace py_const_rex "C<" longdesc in @@ -4520,10 +4556,10 @@ class NBD (object): pr " '''▶ %s\n\n%s'''\n" shortdesc (String.concat "\n&quot...
2017 Sep 20
4
[PATCH 0/4] Replace some uses of the Str module with PCRE.
Str is a pretty ugly regexp module. Let's try to replace it with PCRE. This series of commits goes some small way towards that eventual goal. - - - I wonder if there was a deep reason why we had this? let unix2dos s = String.concat "\r\n" (Str.split_delim (Str.regexp_string "\n") s) I replaced it with what I think should be (nearly) equivalent: let unix2dos s =
2019 Nov 15
0
Wine release 4.20
...35925 Age of Wonders III (version <1.5) has graphical issues (fbo bailing out on context_set_gl_context) 36431 valgrind shows a possible leak in shell32/tests/ebrowser.c 36538 Livestream Procaster needs D3D10CompileEffectFromMemory 38070 Multiple application installers need vbscript:Global_Replace implementation in VBScript custom actions (GEOVIA Surpac 6.x, Hog4PC 3.x) 40442 Unexplained new random comctl32:header failure (cross-compiler issue?) 40950 ProgramFiles(x86) environment variable is not created 41106 Multiple games crash at launch without native .NET 4.0 (Lethe - Episode O...