Displaying 20 results from an estimated 1000 matches similar to: "[PATCH] common/mlstdutils: Add with_openfile function."
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 |
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 ++++----
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.
---
2017 Jul 24
0
[PATCH v3] common/mlstdutils: Build a bytecode version of this library.
Even if ocamlopt is available, always build a bytecode version of
‘common/mlstdutils’.
Furthermore, because this library is pure OCaml, we should not be
using ‘ocamlmklib’. We should use ‘ocaml{c,opt} -a’ 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
2017 Jul 24
0
[PATCH v4] common/mlstdutils: Build a bytecode version of this library.
Even if ocamlopt is available, always build a bytecode version of
‘common/mlstdutils’.
Furthermore, because this library is pure OCaml, we should not be
using ‘ocamlmklib’. We should use ‘ocaml{c,opt} -a’ 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
2017 Jul 24
0
Re: [PATCH v2] common/mlstdutils: Build a bytecode version of this library.
On Thursday, 13 July 2017 16:38:14 CEST Richard W.M. Jones wrote:
> Even if ocamlopt is available, always build a bytecode version of
> ‘common/mlstdutils’.
>
> Furthermore, because this library is pure OCaml, we should not be
> using ‘ocamlmklib’. We should use ‘ocaml{c,opt} -a’ instead. This
> doesn't make any difference for native code, but for bytecode it was
>
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 ++++++++++
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 assert_equal_int = assert_equal ~printer:(fun x -> string_of_int x)
2017 Sep 20
0
[PATCH v2 2/6] common/mlstdutils: Remove unused Libdir module.
Last used in commit fd63d896445260ce83f88e58c0219606f97dca9e (in 2013).
---
.gitignore | 1 -
common/mlstdutils/Makefile.am | 8 --------
2 files changed, 9 deletions(-)
diff --git a/.gitignore b/.gitignore
index 302aa2d81..3aca17f67 100644
--- a/.gitignore
+++ b/.gitignore
@@ -130,7 +130,6 @@ Makefile.in
/common/mlstdutils/.depend
/common/mlstdutils/bytes.ml
2017 Oct 08
0
[PATCH v2 3/4] common/mlstdutils: Introduce Option submodule.
Inspired by ocaml-extlib, introduce a module for handling option
types.
We already had the ‘may’ function (which becomes ‘Option.may’). This
adds also ‘Option.map’ (unused), and ‘Option.default’ functions.
Note this does *not* introduce the unsafe ‘Option.get’ function from
extlib.
---
builder/builder.ml | 6 ++---
builder/index.ml | 27 +++++++++------------
2018 Aug 20
2
[PATCH 1/2] mlstdutils/mltools: factorize the machine-readable option
Store the machine-readable flag globally, just like done for
verbose/debug/etc, and enhance create_standard_options to provide
--machine-readable automatically.
---
common/mlstdutils/std_utils.ml | 4 ++++
common/mlstdutils/std_utils.mli | 7 +++++--
common/mltools/tools_utils.ml | 7 ++++++-
common/mltools/tools_utils.mli | 5 ++++-
4 files changed, 19 insertions(+), 4 deletions(-)
diff
2017 Jul 24
0
Re: [PATCH] common/mlstdutils: Implement StringSet.
On Friday, 21 July 2017 18:11:58 CEST Richard W.M. Jones wrote:
> ---
> builder/sources.ml | 2 --
> common/mlstdutils/Makefile.am | 4 ++-
> common/mlstdutils/stringSet.ml | 19 ++++++++++++
> common/mlstdutils/stringSet.mli | 46 ++++++++++++++++++++++++++++
> dib/elements.ml |
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 ‘Guestfs_config’, ‘Libdir’ and ‘StringMap’ modules are moved
since these are
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 =
2017 Jul 11
2
[PATCH 1/2] builder: fix paths to mlstdutils & mlutils
Followup/fix of commit 61d4891ef48df171a27873efe90aab51a9b711ef.
---
builder/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builder/Makefile.am b/builder/Makefile.am
index 09ae4ae..e64c899 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -311,7 +311,7 @@ depend: .depend
.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml)
rm -f
2017 Jul 13
3
[PATCH v2] common/mlstdutils: Build a bytecode version of this library.
Even if ocamlopt is available, always build a bytecode version of
‘common/mlstdutils’.
Furthermore, because this library is pure OCaml, we should not be
using ‘ocamlmklib’. We should use ‘ocaml{c,opt} -a’ 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
2017 Jul 31
0
[PATCH v11 09/10] daemon: Implement inspection of Windows.
Mostly a line-for-line translation of the C inspection code.
---
daemon/Makefile.am | 2 +
daemon/inspect_fs.ml | 6 +
daemon/inspect_fs_windows.ml | 491 ++++++++++++++++++++++++++++++++++++++++++
daemon/inspect_fs_windows.mli | 24 +++
4 files changed, 523 insertions(+)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index a4657ed86..80314a524 100644
---
2017 Jun 15
0
[PATCH v6 10/41] mllib, v2v: Split out OCaml utils bindings ‘common/mlutils’.
Create a module ‘C_utils’ containing functions like ‘drive_name’ and
‘shell_unquote’ which come from the C utilities.
The new directory ‘common/mlutils’ also contains the ‘Unix_utils’
wrappers around POSIX functions missing from the OCaml stdlib.
---
.gitignore | 3 +
Makefile.am | 24 ++---
builder/Makefile.am
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
2017 Jul 13
1
[PATCH] common/mlstdutils: Always build bytecode version of this library.
Even if ocamlopt is available, always build a bytecode version of
‘common/mlstdutils’.
The generator is always built as bytecode. The generator depends on
‘../common/mlstdutils/guestfs_config.cmo’ and
‘../common/mlstdutils/std_utils.cmo’, but if these have not been built
already then the generator races to build the .cmi files. Since the
generator doesn't have the dependencies covering for