search for: const_re

Displaying 16 results from an estimated 16 matches for "const_re".

Did you mean: condstore
2017 Sep 21
18
[PATCH v2 00/18] Replace many more uses of the Str module with PCRE.
v1 was here: https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html This is a more complete evolution of the earlier patch. It replaces most important uses of Str with PCRE throughout the code. It also extends the bindings with some useful features like case-insensitive regexps. The main places I *didn't* touch are the generator (GObject uses Str extensively); and
2019 Apr 12
0
[supermin PATCH 5/5] utils: remove unused 'compare_architecture' function
...pha" -> 64 - | a -> - error "missing support for architecture '%s'\nIt may need to be added to supermin." - a - in - compare (index_of_architecture a1) (index_of_architecture a2) - (* Parse a size field, eg. "10G". *) let parse_size = let const_re = Str.regexp "^\\([.0-9]+\\)\\([bKMG]\\)$" in diff --git a/src/utils.mli b/src/utils.mli index 7837dbb..b86586a 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -86,9 +86,6 @@ val filter_map : ('a -> 'b option) -> 'a list -> 'b list val compare_version : string...
2015 Jul 13
2
[PATCH 1/2] utils: import parse_size from libguestfs
...ml b/src/utils.ml index 3e81c21..7ae24bd 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -204,3 +204,24 @@ let compare_architecture a1 a2 = exit 1 in compare (index_of_architecture a1) (index_of_architecture a2) + +(* Parse a size field, eg. "10G". *) +let parse_size = + let const_re = Str.regexp "^\\([.0-9]+\\)\\([bKMG]\\)$" in + fun field -> + let matches rex = Str.string_match rex field 0 in + let sub i = Str.matched_group i field in + let size_scaled f = function + | "b" -> Int64.of_float f + | "K" -> Int64.of_float...
2017 Sep 22
27
[PATCH v3 00/22] Replace almost all uses of the Str module with PCRE.
v1: https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html v2: https://www.redhat.com/archives/libguestfs/2017-September/msg00158.html v3 is almost identical to v2, but I have added 4 extra commits to almost finish the job of replacing Str everywhere possible (note it's not possible to replace Str in common/mlstdutils or the generator because those are pure OCaml). As
2019 Apr 12
6
[supermin PATCH 0/5] rpm: fix package selection w/ multilib
This patch series fixes the way supermin sorts the list of installed packages when resolving a name, picking the right package for the host architecture. Pino Toscano (5): rpm: do not unpack parameters rpm: fix version comparison rpm: query the RPM architecture rpm: fix package sorting (RHBZ#1696822) utils: remove unused 'compare_architecture' function src/librpm-c.c | 10
2016 Feb 18
0
[PATCH 3/3] Add and use an helper error function
...eed to be added to supermin.\n" a; - exit 1 + error "missing support for architecture '%s'\nIt may need to be added to supermin." + a in compare (index_of_architecture a1) (index_of_architecture a2) @@ -213,6 +214,5 @@ let parse_size = if matches const_re then ( size_scaled (float_of_string (sub 1)) (sub 2) ) else ( - eprintf "supermin: cannot parse size field '%s'\n" field; - exit 1 + error "cannot parse size field '%s'" field ) diff --git a/src/utils.mli b/src/utils.mli index 1a76...
2016 Feb 18
4
[PATCH 0/3] supermin: miscellaneous cleanups
Hi, few cleanups in the supermin codebase; no actual functional change. Thanks, -- Pino Toscano (3): ext2: simplify tracking of visited modules utils: remove unused run_python function Add and use an helper error function src/build.ml | 20 +++++----------- src/dpkg.ml | 4 +--- src/ext2_initrd.ml | 10 ++++---- src/kernel.ml | 27
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...*<stdlib>*) + let read_whole_file path = let buf = Buffer.create 16384 in let chan = open_in path in @@ -513,6 +597,8 @@ let read_whole_file path = close_in chan; Buffer.contents buf +(*</stdlib>*) + (* Parse a size field, eg. "10G". *) let parse_size = let const_re = Str.regexp "^\\([.0-9]+\\)\\([bKMG]\\)$" in @@ -627,6 +713,8 @@ let create_standard_options argspec ?anon_fun ?(key_opts = false) usage_msg = else []) in Getopt.create argspec ?anon_fun usage_msg +(*<stdlib>*) + (* Compare two version strings intelligently. *) let re...
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...= - let r = input chan b 0 maxlen in - if r > 0 then ( - Buffer.add_substring buf (Bytes.to_string b) 0 r; - loop () - ) - in - loop (); - close_in chan; - Buffer.contents buf - -(*</stdlib>*) - (* Parse a size field, eg. "10G". *) let parse_size = let const_re = Str.regexp "^\\([.0-9]+\\)\\([bKMG]\\)$" in @@ -764,67 +269,6 @@ let create_standard_options argspec ?anon_fun ?(key_opts = false) usage_msg = else []) in Getopt.create argspec ?anon_fun usage_msg -(*<stdlib>*) - -(* Compare two version strings intelligently. *) -let r...
2015 May 15
5
[PATCH 0/4] Only tell people to use -v -x when reporting bugs if they're not using those flags.
.. and a lot of refactoring. https://bugzilla.redhat.com/show_bug.cgi?id=1167623 Rich.
2015 May 15
6
[PATCH v2 0/4] Only tell people to use -v -x when reporting bugs if they're not using those flags.
https://bugzilla.redhat.com/show_bug.cgi?id=1167623
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 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought. We have lots of utility functions, spread all over the repository, with not a lot of structure. This moves many of them under common/ and structures them so there are clear dependencies. This doesn't complete the job by any means. Other items I had on my to-do list for this change were: - Split up mllib/common_utils into: -
2017 Jun 12
32
[PATCH v5 00/32] Refactor utilities, implement some APIs in OCaml.
This is a combination of: https://www.redhat.com/archives/libguestfs/2017-June/msg00046.html [PATCH 00/12] Refactor utility functions. plus: https://www.redhat.com/archives/libguestfs/2017-June/msg00023.html [PATCH v3 00/19] Allow APIs to be implemented in OCaml. with the second patches rebased on top of the utility refactoring, and some other adjustments and extensions. This passes
2017 Jun 15
45
[PATCH v6 00/41] Refactor utilities, reimplement inspection in the daemon.
v5: https://www.redhat.com/archives/libguestfs/2017-June/msg00065.html Since v5, this now implements inspection almost completely for Linux and Windows guests. Rich.
2017 Jun 21
45
[PATCH v8 00/42] Refactor utilities and reimplement inspection.
v7 was: https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html https://www.redhat.com/archives/libguestfs/2017-June/msg00184.html I believe this addresses all comments received so far. Also it now passes a test where I compared about 100 disk images processed with old and new virt-inspector binaries. The output is identical in all cases except one which is caused by a bug in blkid