search for: std_util

Displaying 20 results from an estimated 248 matches for "std_util".

Did you mean: std_utils
2019 Jan 11
3
[PATCH 1/3] mlstdutils: add a very simple test for Std_utils.which
--- common/mlstdutils/std_utils_tests.ml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/mlstdutils/std_utils_tests.ml b/common/mlstdutils/std_utils_tests.ml index 81f512cbf..f7b0247a4 100644 --- a/common/mlstdutils/std_utils_tests.ml +++ b/common/mlstdutils/std_utils_tests.ml @@ -29,6 +29,11 @@ let asse...
2017 Jul 21
3
[PATCH] common/mlstdutils: Add chomp function to remove \n from end of strings.
This is like the Perl chomp function, it removes a single \n from the end of a string if present, else leaves the string alone. I believe I found the only (two) places where such a function is used, but there may be a few more lurking. --- common/mlstdutils/std_utils.ml | 7 +++++++ common/mlstdutils/std_utils.mli | 2 ++ common/mlstdutils/std_utils_tests.ml | 10 ++++++++++ mllib/common_utils.ml | 10 ++-------- v2v/linux_bootloaders.ml | 8 ++------ 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/comm...
2017 Jun 16
1
Re: [PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
On Thursday, 15 June 2017 19:05:54 CEST Richard W.M. Jones wrote: > The new module ‘Std_utils’ contains only functions which are pure > OCaml and depend only on the OCaml stdlib. Therefore these functions > may be used by the generator. Hm can we please use a better name than Std_utils? Otherwise there's a bit of confusion between two generic names such as Std_utils and Common_...
2017 Oct 08
0
[PATCH v2 1/4] common/mlstdutils: Extend the List module.
We defined a number of functions on lists which are not provided by the standard library. As with Char and String, let's extend List to add these new functions to a List pseudo-module (really Std_utils.List, but called List when you ‘open Std_utils’). The initial exported functions are all List functions from OCaml 3.11 + iteri + mapi. We can add other functions as needed. --- common/mlstdutils/std_utils.ml | 4 ++++ common/mlstdutils/std_utils.mli | 47 +++++++++++++++++++++++++++++++++++++...
2023 May 20
1
[libguestfs-common PATCH] Add support for OCaml 5.0
Pervasives is deprecated since Ocaml 4.08 and has been removed in OCaml 5.0. https://github.com/ocaml/ocaml/pull/1605 --- mlstdutils/std_utils.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlstdutils/std_utils.ml b/mlstdutils/std_utils.ml index 0d2fa22..86b21a7 100644 --- a/mlstdutils/std_utils.ml +++ b/mlstdutils/std_utils.ml @@ -341,12 +341,12 @@ module List = struct | x::xs, y::ys, z::zs -> (x, y...
2017 Nov 07
0
[PATCH] common/mlstdutils: Add with_openfile function.
This safe wrapper around Unix.openfile ensures that exceptions escaping cannot leave unclosed files. There are only a few places in the code where this wrapper can be used currently. There are other occurences of Unix.openfile but they are not suitable for replacement. --- common/mlstdutils/std_utils.ml | 4 ++++ common/mlstdutils/std_utils.mli | 6 ++++++ daemon/devsparts.ml | 5 ++--- daemon/inspect_fs_windows.ml | 7 +++---- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml index ee6bea5af..5d451fa...
2017 Nov 05
0
[PATCH 2/2] common/mlstdutils: Add with_openfile function.
This safe wrapper around Unix.openfile ensures that exceptions escaping cannot leave unclosed files. There are only a few places in the code where this wrapper can be used currently. There are other occurences of Unix.openfile but they are not suitable for replacement. --- common/mlstdutils/std_utils.ml | 4 ++++ common/mlstdutils/std_utils.mli | 6 ++++++ daemon/devsparts.ml | 5 ++--- daemon/inspect_fs_windows.ml | 18 ++++++++---------- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml index ee...
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
The new module ‘Std_utils’ contains only functions which are pure OCaml and depend only on the OCaml stdlib. Therefore these functions may be used by the generator. The new module is moved to ‘common/mlstdutils’. This also removes the "<stdlib>" hack, and the code which copied the library around. Also ‘...
2017 Nov 05
3
[PATCH 1/2] common/mlstdutils: Add with_open_in and with_open_out functions.
These safe wrappers around Pervasives.open_in and Pervasives.open_out ensure that exceptions escaping cannot leave unclosed files. --- common/mlstdutils/std_utils.ml | 39 ++++++++++++++++++++-------------- common/mlstdutils/std_utils.mli | 12 +++++++++++ common/mltools/tools_utils.ml | 39 +++++++++++++++++----------------- dib/dib.ml | 9 ++++---- generator/bindtests.ml | 26 ++++++++++++----------- generator/utils.ml...
2017 Sep 26
5
[PATCH 0/5] Miscellaneous refactoring of common/utils, create common/mltools
Miscellaneous refactoring, but the main one is to rename mllib/ as common/mltools/ Rich.
2019 Jan 11
0
[PATCH 3/3] OCaml: use the new behaviour of Std_utils.which
Since Std_utils.which can handle relative/absolute paths, remove the manual checks, and use Std_utils.which directly. --- common/mltools/tools_utils.ml | 4 +--- dib/cmdline.ml | 12 +----------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/common/mltools/tools_utils.ml b/commo...
2020 Jan 13
4
[PATCH] Link .mli files corresponding to autorgenerated .ml files into builddir
This avoids build failures in separate builds such as this one: ,---- | ocamlfind ocamlc -package str,unix -I . -a guestfs_config.cmo stringMap.cmo stringSet.cmo std_utils.cmo -o mlstdutils.cma | ar cr libmlstdutils.a libmlstdutils_a-dummy.o | ranlib libmlstdutils.a | File "_none_", line 1: | Error: Files std_utils.cmo and guestfs_config.cmo | make inconsistent assumptions over interface Guestfs_config | make[4]: *** [Makefile:2580: mlstdutils.cma]...
2017 Nov 21
2
[PATCH REPOST 1/2] common/mlstdutils: Add return statement.
No change, just reposting without the "for discussion" tag. I think we should allow this as it seems like a nice coding style for a limited subset of imperative-style code. Rich.
2017 Nov 05
2
[PATCH 0/2] (mainly for discussion) Add ‘return’ statement.
When rewriting the heavily imperative original inspection code, I longed for a ‘return’ statement so I could keep the new code as close as possible to the original. OCaml of course does not have such a statement, but it's relatively simply to implement it in the language. The first patch does so, and the second patch rewrites a sample of the inspection code to use it. Rich.
2018 May 22
1
[PATCH] v2v: Use Std_utils.qemu_input_filename instead of prefixing "file:" to filename (RHBZ#1580292).
This also allows us to use virt-v2v with the old version of qemu in RHEL 7. Fixes commit e29296cfa20dd691995832940a30fe2e6b98149a. Thanks: Pino Toscano for suggesting the fix. --- v2v/v2v.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2v/v2v.ml b/v2v/v2v.ml index 54a2b3998..363699701 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -744,7 +744,7 @@ and copy_targets cmdline
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from: https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html I believe this addresses everything raised in comments on that patch series. Rich.
2017 Nov 07
1
Re: [PATCH v2 1/4] common/mlstdutils: Extend the List module.
On Sunday, 8 October 2017 23:26:53 CET Richard W.M. Jones wrote: > We defined a number of functions on lists which are not provided by > the standard library. As with Char and String, let's extend List to > add these new functions to a List pseudo-module (really > Std_utils.List, but called List when you ‘open Std_utils’). > > The initial exported functions are all List functions from OCaml 3.11 > + iteri + mapi. We can add other functions as needed. > --- My worry about this is that: - OCaml does not have OOTB support for conditional code depending on...
2017 Oct 08
0
[PATCH v2 3/4] common/mlstdutils: Introduce Option submodule.
...nused), and ‘Option.default’ functions. Note this does *not* introduce the unsafe ‘Option.get’ function from extlib. --- builder/builder.ml | 6 ++--- builder/index.ml | 27 +++++++++------------ builder/list_entries.ml | 20 +++++++--------- common/mlstdutils/std_utils.ml | 18 ++++++++++---- common/mlstdutils/std_utils.mli | 15 +++++++++--- common/mltools/tools_utils.ml | 6 ++--- customize/customize_main.ml | 4 ++-- daemon/inspect_types.ml | 52 ++++++++++++++++++++--------------------- dib/dib.ml | 4 ++-- resize/resiz...
2017 Jul 24
0
[PATCH v3] common/mlstdutils: Build a bytecode version of this library.
...instead. This doesn't make any difference for native code, but for bytecode it was building a broken library. The original reason for making this change is because the generator is always built as bytecode, and it depended on ‘../common/mlstdutils/guestfs_config.cmo’ and ‘../common/mlstdutils/std_utils.cmo’. On native code platforms these were not built before the generator and so the generator races to build the .cmi and .cmo files. Since the generator doesn't have correct dependencies covering the ‘common/mlstdutils’ directory you can get a broken link on fast machines: File "../...
2017 Jul 24
0
[PATCH v4] common/mlstdutils: Build a bytecode version of this library.
...instead. This doesn't make any difference for native code, but for bytecode it was building a broken library. The original reason for making this change is because the generator is always built as bytecode, and it depended on ‘../common/mlstdutils/guestfs_config.cmo’ and ‘../common/mlstdutils/std_utils.cmo’. On native code platforms these were not built before the generator and so the generator races to build the .cmi and .cmo files. Since the generator doesn't have correct dependencies covering the ‘common/mlstdutils’ directory you can get a broken link on fast machines: File "../...