Displaying 15 results from an estimated 15 matches for "read_ini".
2014 Apr 22
3
[PATCH 1/2] builder: add an optional suffix string for INI parsing errors
...elds = field array
(* Calls yyparse in the C code. *)
-external parse_index : prog:string -> string -> c_sections = "virt_builder_parse_index"
+external parse_index : prog:string -> error_suffix:string -> string -> c_sections = "virt_builder_parse_index"
-let read_ini ~prog file =
- let sections = parse_index ~prog file in
+let read_ini ~prog ?(error_suffix = "") file =
+ let sections = parse_index ~prog ~error_suffix file in
let sections = Array.to_list sections in
List.map (
fun (n, fields) ->
diff --git a/builder/ini_reader.mli b/bui...
2014 Mar 19
7
[PATCH 1/3] builder: make the C index parser reentrant
Switch the lex/yacc parser into reentrant mode, to ease the handling of
parsing-specific data; introduce a new parser_context struct for that,
which is added as extra data to the parser.
This should cause no behaviour changes in the parsing, just no more
global variables used for getting data in/out the parser.
---
builder/index-parse.y | 44 ++++++++++++++++++++++++++++++++++++------
2015 Jul 08
7
[PATCH 0/6] RFC: basic subscription-manager support in virt-customize
...e same operations are doable also using --run-command, but this
avoids showing username/passwords/pools on command lines, and in
general encapsulate them for better control.
Thanks,
--
Pino
Pino Toscano (6):
Move ini_reader from builder to mllib
mllib: add a real_uri parameter to Ini_reader.read_ini
mllib: add duplicate fields check to Ini_reader.read_ini
mllib: add duplicate sections check to Ini_reader.read_ini
mllib: add quick section/key lookup method
customize: add basic subscription-manager operations
.gitignore | 6 +-
builder/Makefile.am | 40 ++++---...
2015 Jul 08
0
[PATCH 6/6] customize: add basic subscription-manager operations
...tomize_run.ml
@@ -153,6 +153,33 @@ exec >>%s 2>&1
Hashtbl.replace passwords user pw
in
+ (* Parse the subscription-manager configuration. *)
+ let sm_config =
+ match ops.flags.sm_config with
+ | None -> None
+ | Some c ->
+ try
+ Some (Ini_reader.read_ini ~check_duplicated_sections:true
+ ~check_duplicated_fields:true c)
+ with exn ->
+ error (f_"cannot parse the subscription-manager configuration: %s")
+ (Printexc.to_string exn)
+ in
+ let sm_config_get_value group key =
+ let conf =
+ matc...
2016 Oct 24
0
[PATCH 2/2] builder: consolidate handling of temporary files/dirs
...let tmpfile, _ = Downloader.download downloader ~proxy uri in
(* Check index file signature (also verifies it was fully
* downloaded and not corrupted in transit).
@@ -41,8 +41,6 @@ let get_index ~downloader ~sigchecker
(* Try parsing the file. *)
let sections = Ini_reader.read_ini tmpfile in
- if delete_tmpfile then
- (try Unix.unlink tmpfile with _ -> ());
(* Check for repeated os-version+arch combination. *)
let name_arch_map = List.map (
diff --git a/builder/sigchecker.ml b/builder/sigchecker.ml
index c1cc1f3..4c0d78e 100644
--- a/builder/sigchecker...
2016 Oct 25
0
[PATCH v2 2/2] builder: consolidate handling of temporary files/dirs
...let tmpfile, _ = Downloader.download downloader ~proxy uri in
(* Check index file signature (also verifies it was fully
* downloaded and not corrupted in transit).
@@ -41,8 +41,6 @@ let get_index ~downloader ~sigchecker
(* Try parsing the file. *)
let sections = Ini_reader.read_ini tmpfile in
- if delete_tmpfile then
- (try Unix.unlink tmpfile with _ -> ());
(* Check for repeated os-version+arch combination. *)
let name_arch_map = List.map (
diff --git a/builder/sigchecker.ml b/builder/sigchecker.ml
index c1cc1f3..4c0d78e 100644
--- a/builder/sigchecker...
2016 Oct 25
2
[PATCH v2 1/2] mllib: curl: add optional tmpdir parameter
Add a new optional parameter for the Curl ADT, so temporary files can be
created in a specified directory (which is supposed to be temporary, and
disposed only when the application quits).
---
mllib/curl.ml | 10 ++++++----
mllib/curl.mli | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/mllib/curl.ml b/mllib/curl.ml
index 376406e..baa75ec 100644
--- a/mllib/curl.ml
+++
2016 Oct 24
2
[PATCH 1/2] mllib: curl: add optional tmpdir parameter
Add a new optional parameter for the Curl ADT, so temporary files can be
created in a specified directory (which is supposed to be temporary, and
disposed only when the application quits).
---
mllib/curl.ml | 16 +++++++++++-----
mllib/curl.mli | 2 +-
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/mllib/curl.ml b/mllib/curl.ml
index 376406e..7d07125 100644
--- a/mllib/curl.ml
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
2016 May 22
0
[PATCH 2/2] ocaml tools: Use a common debug function.
...ces.ml
+++ b/builder/sources.ml
@@ -36,9 +36,7 @@ and source_format =
module StringSet = Set.Make (String)
let parse_conf file =
- if verbose () then (
- printf (f_"%s: trying to read %s\n") prog file;
- );
+ debug "trying to read %s" file;
let sections = Ini_reader.read_ini ~error_suffix:"[ignored]" file in
let sources = List.fold_right (
@@ -55,20 +53,16 @@ let parse_conf file =
try Some (URI.parse_uri (List.assoc ("gpgkey", None) fields)) with
| Not_found -> None
| Invalid_argument "URI.parse_ur...
2016 May 22
4
ocaml tools: Use a common debug function.
Add a Common_utils.debug function for printing messages
only when in verbose mode.
Rich.
2014 Feb 25
12
[PATCH 0/8] virt-builder: use .conf files for configuration
Hi,
attached there is a serie of patches that completes the work on making
virt-builder use .conf files, shipped in XDG directories, to configure
all the available sources of indexes used.
This also removes the hardcoded default location, replaced now with a
configuration file (which may be not used at all).
Thanks,
Pino Toscano (8):
builder: allow "no key" as key in Sigchecker
2017 Jul 21
4
[PATCH] common/mlstdutils: Implement StringSet.
...index 4c9ea0fff..48687bb26 100644
--- a/builder/sources.ml
+++ b/builder/sources.ml
@@ -34,8 +34,6 @@ and source_format =
| FormatNative
| FormatSimpleStreams
-module StringSet = Set.Make (String)
-
let parse_conf file =
debug "trying to read %s" file;
let sections = Ini_reader.read_ini ~error_suffix:"[ignored]" file in
diff --git a/common/mlstdutils/Makefile.am b/common/mlstdutils/Makefile.am
index a6357bf6c..108adcc52 100644
--- a/common/mlstdutils/Makefile.am
+++ b/common/mlstdutils/Makefile.am
@@ -24,13 +24,15 @@ EXTRA_DIST = \
SOURCES_MLI = \
std_utils.mli \
-...
2015 May 15
0
[PATCH 3/4] ocaml tools: Use global variables to store trace (-x) and verbose (-v) flags.
...+++ b/builder/sources.ml
@@ -31,8 +31,8 @@ type source = {
module StringSet = Set.Make (String)
-let parse_conf ~verbose file =
- if verbose then (
+let parse_conf file =
+ if verbose () then (
printf (f_"%s: trying to read %s\n") prog file;
);
let sections = Ini_reader.read_ini ~error_suffix:"[ignored]" file in
@@ -51,7 +51,7 @@ let parse_conf ~verbose file =
try Some (URI.parse_uri (List.assoc ("gpgkey", None) fields)) with
| Not_found -> None
| Invalid_argument "URI.parse_uri" as ex ->
-...