search for: lowercase_ascii

Displaying 20 results from an estimated 94 matches for "lowercase_ascii".

2015 Oct 06
0
[PATCH 3/5] mllib: Add (Char|String).(lower|upper)case_ascii functions.
...- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index f375317..97363df 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -22,10 +22,23 @@ open Common_gettext.Gettext module Char = struct include Char + + let lowercase_ascii c = + if (c >= 'A' && c <= 'Z') + then unsafe_chr (code c + 32) + else c + + let uppercase_ascii c = + if (c >= 'a' && c <= 'z') + then unsafe_chr (code c - 32) + else c end module String = struct...
2015 Oct 07
1
Re: [PATCH 3/5] mllib: Add (Char|String).(lower|upper)case_ascii functions.
...t; > diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml > index f375317..97363df 100644 > --- a/mllib/common_utils.ml > +++ b/mllib/common_utils.ml > @@ -22,10 +22,23 @@ open Common_gettext.Gettext > > module Char = struct > include Char > + > + let lowercase_ascii c = > + if (c >= 'A' && c <= 'Z') > + then unsafe_chr (code c + 32) > + else c > + > + let uppercase_ascii c = > + if (c >= 'a' && c <= 'z') > + then unsafe_chr (code c - 32) > + els...
2018 Nov 07
1
Re: [PATCH v3 1/3] v2v: refactor copy_drivers() in Windows_virtio
...in > let paths = external_command cmd in > List.iter ( > fun path -> > - if virtio_iso_path_matches_guest_os path inspect then ( > - let source = virtio_win // path in > - let target = driverdir // > - String.lowercase_ascii (Filename.basename path) in > - debug "copying virtio driver bits: 'host:%s' -> '%s'" > + if filter path inspect then ( > + let source = dir // path in > + let target_name = String.lowercase_ascii (Filename.basename path) in...
2016 Aug 25
1
[PATCH] mllib: Add String.map function for OCaml < 4.00.0.
String.map was added in OCaml 4.00.0. However we use this function to implement String.lowercase_ascii etc. Therefore include a definition of the function for older versions of OCaml. (Debian Wheezy has OCaml 3.12.1.) --- mllib/common_utils.ml | 8 ++++++++ mllib/common_utils.mli | 2 ++ 2 files changed, 10 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 9210cf8.....
2016 Aug 25
1
[PATCH 1.32] mllib: Add String.map function for OCaml < 4.00.0.
Same patch as just posted, but this is the modified version required for the stable-1.32 branch. Rich.
2018 Nov 07
0
[PATCH v3 1/3] v2v: refactor copy_drivers() in Windows_virtio
...; find -L -type f" (quote dir) in let paths = external_command cmd in List.iter ( fun path -> - if virtio_iso_path_matches_guest_os path inspect then ( - let source = virtio_win // path in - let target = driverdir // - String.lowercase_ascii (Filename.basename path) in - debug "copying virtio driver bits: 'host:%s' -> '%s'" + if filter path inspect then ( + let source = dir // path in + let target_name = String.lowercase_ascii (Filename.basename path) in + let targ...
2018 Nov 13
0
[PATCH v4 1/3] v2v: refactor copy_drivers() in Windows_virtio
...; find -L -type f" (quote dir) in let paths = external_command cmd in List.iter ( fun path -> - if virtio_iso_path_matches_guest_os path inspect then ( - let source = virtio_win // path in - let target = driverdir // - String.lowercase_ascii (Filename.basename path) in - debug "copying virtio driver bits: 'host:%s' -> '%s'" + if filter path inspect then ( + let source = dir // path in + let target_name = String.lowercase_ascii (Filename.basename path) in + let targ...
2018 Nov 06
0
[PATCH 1/3] v2v: refactor copy_drivers() in Windows_virtio
...; find -L -type f" (quote dir) in let paths = external_command cmd in List.iter ( fun path -> - if virtio_iso_path_matches_guest_os path inspect then ( - let source = virtio_win // path in - let target = driverdir // - String.lowercase_ascii (Filename.basename path) in - debug "copying virtio driver bits: 'host:%s' -> '%s'" + if filter path inspect then ( + let source = dir // path in + let target_name = String.lowercase_ascii (Filename.basename path) in + let targ...
2015 Oct 13
2
[PATCH v2 2/4] v2v: copy virtio drivers without guestfs handle leak
...ist.iter ( + fun path -> + if (match_vio_path_with_os path inspect.i_arch + inspect.i_major_version inspect.i_minor_version + inspect.i_product_variant) then ( + let source = virtio_win // path in + let target = driverdir // (String.lowercase_ascii + (Filename.basename path)) in + if verbose () then + printf "Copying virtio driver bits: 'host:%s' -> '%s'\n" + source target; + + g#write target (read_whole_file source) +...
2018 Dec 05
1
[PATCH v4] v2v: don't fail when virtio-win does not have qemu-ga
This is why I shouldn't program before lunchtime ... v2 & v3 omitted gettext (‘f_()’) annotations around the warning and error strings. Fixed in this version. My cover letter for v2 still applies here. Rich.
2018 Dec 04
2
[PATCH] v2v: don't fail when virtio-win does not have qemu-ga packages
...ectory %s" dir; - let cmd = sprintf "cd %s && find -L -type f" (quote dir) in - let paths = external_command cmd in - List.iter ( - fun path -> - if filter path inspect then ( - let source = dir // path in - let target_name = String.lowercase_ascii (Filename.basename path) in - let target = destdir // target_name in - debug "windows: copying guest tools bits: 'host:%s' -> '%s'" - source target; - - g#write target (read_whole_file source); - List.push_front target_...
2018 Nov 13
4
[PATCH v5 0/3] Install QEMU-GA from oVirt guest tools ISO on Linux
changes in v5: - simplified expression in copy_drivers - new commit fixing path constructions - indentation fixes changes in v4: - fix call to install_local changes in v2: - moved copy_drivers above copy_files - renamed copy_files to copy_from_virtio_win - renamed install to install_local - use rpm instead of yum This installs packages with QEMU Guest Agent when converting Linux machine. The
2018 Dec 05
1
[PATCH v2] v2v: don't fail when virtio-win does not have qemu-ga
This is my version of this patch which I think improves it in a number of ways. Firstly instead of having the bare boolean parameter ‘ok_if_missing’ we pass in the function we want to call along the directory missing path. This change then allows us to print a more useful error or warning message given the context of the call, and the new message is actionable too, so the user knows what has to
2018 Dec 05
1
[PATCH v3] v2v: don't fail when virtio-win does not have qemu-ga
Sorry, there was a small mistake in v2 of the patch. The difference between v2 & v3 is below. All my other comments in the cover letter of v2 also apply here. Rich. --- a/v2v/windows_virtio.ml +++ b/v2v/windows_virtio.ml @@ -293,8 +293,7 @@ and copy_drivers g inspect driverdir = [] <> copy_from_virtio_win g inspect "/" driverdir virtio_iso_path_matches_guest_os
2018 Nov 06
7
[PATCH 0/3] Install QEMU-GA from oVirt guest tools ISO on Linux
This installs packages with QEMU Guest Agent when converting Linux machine. The packages should be available on guest tools ISO. The patches work "as-is" but probably deserve some more attention: - it is "abusing" Winows_virtio code but renaming/refactoring everything to remove "windows" from the name and use "guest tools" seems like a lot of unnecesary
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.
2018 Nov 07
3
[PATCH v2 0/3] Install QEMU-GA from oVirt guest tools ISO on Linux
changes in v2: - moved copy_drivers above copy_files - renamed copy_files to copy_from_virtio_win - renamed install to install_local - use rpm instead of yum This installs packages with QEMU Guest Agent when converting Linux machine. The packages should be available on guest tools ISO. The patches work "as-is" but probably deserve some more attention: - it is "abusing"
2016 Jun 03
2
[PATCH] v2v: copy all driver files into guest
...le changed, 11 deletions(-) diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml index 6c8396c..354aa19 100644 --- a/v2v/windows_virtio.ml +++ b/v2v/windows_virtio.ml @@ -291,17 +291,6 @@ and virtio_iso_path_matches_guest_os path inspect = * elements. *) let lc_path = String.lowercase_ascii path in - let lc_basename = Filename.basename lc_path in - - let extension = - match last_part_of lc_basename '.' with - | Some x -> x - | None -> raise Not_found - in - - (* Skip files without specific extensions. *) - let extensions = ["cat";...
2018 Nov 07
10
[PATCH v3 0/3] Install QEMU-GA from oVirt guest tools ISO on Linux
changes in v3: - fix call to install_local changes in v2: - moved copy_drivers above copy_files - renamed copy_files to copy_from_virtio_win - renamed install to install_local - use rpm instead of yum This installs packages with QEMU Guest Agent when converting Linux machine. The packages should be available on guest tools ISO. The patches work "as-is" but probably deserve some more
2015 Nov 17
0
[PATCH 2/3] v2v: windows: Add a Windows '*.inf' file parser.
...t comment_rex "" value in + key, value + ) lines in + header, lines + ) sections in + + (* Normalize (by lowercasing) the section headers and keys (but not + * the values). + *) + let sections = List.map ( + fun (header, lines) -> + let header = String.lowercase_ascii header in + let lines = List.map ( + fun (key, value) -> + String.lowercase_ascii key, value + ) lines in + header, lines + ) sections in + + sections + +let find_section t section_name = + let section_name = String.lowercase_ascii section_name in + List.assoc...