Displaying 2 results from an estimated 2 matches for "opset_of_oplist".
2014 Jan 13
2
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
On Friday 10 January 2014 10:09:19 Richard W.M. Jones wrote:
> On Thu, Jan 09, 2014 at 03:45:54PM +0000, Richard W.M. Jones wrote:
> > On Thu, Jan 09, 2014 at 04:21:10PM +0100, Pino Toscano wrote:
> > > + and set_operations op_string =
> > > + let currentopset =
> > > + match (!operations) with
> >
> > No need for parentheses around
2014 Jan 13
0
[PATCH] sysprep: add --operations
..._"Force SELinux relabel";
diff --git a/sysprep/sysprep_operation.ml b/sysprep/sysprep_operation.ml
index 1fb4f17..572a65f 100644
--- a/sysprep/sysprep_operation.ml
+++ b/sysprep/sysprep_operation.ml
@@ -68,10 +68,34 @@ type set = OperationSet.t
let empty_set = OperationSet.empty
+let opset_of_oplist li =
+ List.fold_left (
+ fun acc elem ->
+ OperationSet.add elem acc
+ ) empty_set li
+
let add_to_set name set =
let op = List.find (fun { name = n } -> name = n) !all_operations in
OperationSet.add op set
+let add_defaults_to_set set =
+ OperationSet.union set (opset_of...