Displaying 16 results from an estimated 16 matches for "empty_set".
2014 Jan 13
2
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
...erationSet.fold (
> > + fun elem opset ->
> > + if List.exists (
> > + fun li ->
> > + li.name = elem.name
> > + ) l then
> > + opset
> > + else
> > + OperationSet.add elem opset
> > + ) set empty_set
>
> OCaml Set has subset, intersection, difference operations if you need
> them. See /usr/lib64/ocaml/set.mli
True; I went with manual folding to avoid build new temporary sets when
needed, but I guess doing this could be more natural.
--
Pino Toscano
2014 Jan 13
0
[PATCH] sysprep: add --operations
...files changed, 131 insertions(+), 7 deletions(-)
diff --git a/sysprep/main.ml b/sysprep/main.ml
index 689a394..49750a9 100644
--- a/sysprep/main.ml
+++ b/sysprep/main.ml
@@ -87,6 +87,40 @@ let debug_gc, operations, g, selinux_relabel, quiet, mount_opts =
exit 1
) Sysprep_operation.empty_set ops in
operations := Some opset
+ and set_operations op_string =
+ let currentopset =
+ match !operations with
+ | Some x -> x
+ | None -> Sysprep_operation.empty_set
+ in
+ let ops = string_nsplit "," op_string in
+ let opset = List.fold_left (
+...
2014 Jan 09
2
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
...let remove_list_from_opset l set =
> + OperationSet.fold (
> + fun elem opset ->
> + if List.exists (
> + fun li ->
> + li.name = elem.name
> + ) l then
> + opset
> + else
> + OperationSet.add elem opset
> + ) set empty_set
OCaml Set has subset, intersection, difference operations if you need
them. See /usr/lib64/ocaml/set.mli
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100...
2017 Feb 02
7
[PATCH 0/6] dib: various improvements
Hi,
this series improves virt-dib, adding some upstream changes, and
refactoring the handling of output formats.
Thanks,
Pino Toscano (6):
dib: clear up "already provided" message
dib: add --checksum
dib: pass custom mkfs options after the filesystem type
dib: refactor output formats handling
dib: clarify "output:" lines in --machine-readable documentation
dib:
2014 Jan 07
2
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
On Tuesday 07 January 2014 12:12:43 Richard W.M. Jones wrote:
> On Tue, Jan 07, 2014 at 11:16:08AM +0100, Pino Toscano wrote:
> > On Friday 27 December 2013 10:58:15 you wrote:
> > > virt-sysprep either runs with all default operations or a selected
> > > list of operations with the --enable argument. A few times I've
> > > found I'd like to use the
2006 Jan 09
3
prod(numeric(0)) surprise
It surprised me that prod(numeric(0)) is 1.
I guess if you say (operation(nothing) == identity
element) this makes sense, but ??
Looking in the code, this makes sense:
basically (s=1; for i=0 to length(x),
multiply s by x[i]) -- which comes out to 1.
What *should* prod(numeric(0)) produce?
I couldn't find the answer documented anywhere.
(And how about sum(numeric(0))==0,
which for
2012 Mar 31
3
[PATCH (incomplete)] Rewrite virt-sysprep in OCaml.
This patch is incomplete but it illustrates the idea. virt-sysprep is
rewritten as a modular tool in OCaml.
Only the 'utmp' and 'hostname' operations are implemented at the
moment.
Rich.
2015 Oct 06
0
[PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*
..."," ops in
+ let ops = String.nsplit "," ops in
let opset = List.fold_left (
fun opset op_name ->
try Sysprep_operation.add_to_set op_name opset
@@ -86,11 +86,11 @@ let main () =
| Some x -> x
| None -> Sysprep_operation.empty_set
in
- let ops = string_nsplit "," op_string in
+ let ops = String.nsplit "," op_string in
let opset = List.fold_left (
fun opset op_name ->
let op =
- if string_prefix op_name "-" then
+ if String.is_p...
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.
2016 Jul 07
12
[PATCH v3 0/8] v2v: Move Curl wrapper to mllib and more.
v2 -> v3:
- Changes to the Curl API suggested by Pino.
2016 Jul 07
9
[PATCH v2 0/8] v2v: Move Curl wrapper to mllib and use it for virt-builder (and more).
v1 -> v2:
- Fixed the bug with precedence of if / @.
- Add some imperative list operators inspired by Perl, and use those
for constructing the Curl arguments, and more.
Rich.
2017 Nov 21
2
[PATCH v3 0/2] common/mlstdutils: Extend the List module.
v2 -> v3:
- Renamed List.assoc_ -> List.assoc_lbl.
- Rebased on top of current master branch.
Rich.
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...irt-dib(1).
fun fmtset fmt ->
try Output_format.add_to_set fmt fmtset
with Not_found ->
- error (f_"invalid format '%s' in --formats") fmt
+ error (f_"invalid format ‘%s’ in --formats") fmt
) Output_format.empty_set fmts in
formats := Some fmtset in
@@ -162,7 +162,7 @@ read the man page virt-dib(1).
[ L"exclude-script" ], Getopt.String ("script", append_excluded_script),
s_"Exclude the specified script";
[ L"envvar" ], Getopt.String ("env...
2017 Oct 08
4
[PATCH 0/3] common/mlstdutils: Add Std_utils List and Option modules.
In Std_utils we already extend Char and String. These commits take it
a little further by extending List and adding a new Option submodule.
All basically simple refactoring.
Rich.
2017 Oct 08
7
[[PATCH v2 0/4] common/mlstdutils: Add Std_utils List and Option modules.
This time including the first commit ...
2012 Apr 30
5
[PATCH 0/4 v1] Remove gettextify, implement OCaml gettext.
Version 1 of the patch, for discussion, but not to be applied. It
does work, but needs a lot more testing.
This removes all the psychopathic gettextify cruft, and replaces it
with a 99 line Makefile.am. A large win, I think.
The third patch implements gettext support in the OCaml tools.
The fourth patch is just for illustration. It shows the consequent
changes to libguestfs.pot and the po