search for: input_line

Displaying 20 results from an estimated 71 matches for "input_line".

2017 Nov 05
3
[PATCH 1/2] common/mlstdutils: Add with_open_in and with_open_out functions.
...) - ) - in - loop (); - close_in chan; + ); Buffer.contents buf (* Compare two version strings intelligently. *) @@ -824,10 +833,10 @@ let last_part_of str sep = with Not_found -> None let read_first_line_from_file filename = - let chan = open_in filename in - let line = try input_line chan with End_of_file -> "" in - close_in chan; - line + with_open_in filename ( + fun chan -> + try input_line chan with End_of_file -> "" + ) let is_regular_file path = (* NB: follows symlinks. *) try (Unix.stat path).Unix.st_kind = Unix.S_REG diff -...
2019 Aug 13
0
[PATCH 3/3] generator: improve pod2text invocation
...+ "pod2text" in + let chan_out, chan_in = open_process cmd in + output_string chan_in "=encoding utf8\n\n"; + output_string chan_in (sprintf "=head1 %s\n\n%s\n" name longdesc); + close_out chan_in; let lines = ref [] in - let rec loop i = - let line = input_line chan in - if i = 1 && discard then (* discard the first line of output *) - loop (i+1) - else ( - let line = if trim then String.triml line else line in - lines := line :: !lines; - loop (i+1) - ) in - let lines : pod2text_memo_value = try loop 1 with End_of_f...
2015 Jul 17
0
[PATCH 1/2] mllib: add and use read_first_line_from_file
...quot; password); pw_locked = false } @@ -71,12 +71,6 @@ and parse_selector_list orig_arg = function | _ -> error (f_"invalid password selector '%s'; see the man page") orig_arg -and read_password_from_file filename = - let chan = open_in filename in - let password = input_line chan in - close_in chan; - password - (* Permissible characters in a salt. *) let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./" diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 083c5d5..f9e8996 100644 --- a/mllib/common_utils.ml +++ b/mll...
2019 Aug 13
5
[PATCH 0/3] generator: pod2text-related improvements
- refactor memoization code - pass pod as stdin rather than files Pino Toscano (3): generator: isolate memoized cache in own module generator: adjust variable names generator: improve pod2text invocation generator/Makefile.am | 3 ++ generator/memoized_cache.ml | 62 +++++++++++++++++++++ generator/memoized_cache.mli | 29 ++++++++++ generator/utils.ml | 101
2015 Feb 10
1
[PATCH] php: add a simple bindtests test
...\n\");\n"; + pr " exit;\n"; + pr "}\n"; + ); + + pr "echo (\"EOF\\n\");\n"; + pr "?>\n"; + pr "--EXPECT--\n"; + + let dump filename = + let chan = open_in filename in + let rec loop () = + let line = input_line chan in + (match string_split ":" line with + | ("obool"|"oint"|"oint64"|"ostring"|"ostringlist") as x :: _ -> + pr "%s: unset\n" x + | _ -> pr "%s\n" line + ); + loop () + in +...
2016 Oct 05
4
[PATCH v2 0/2] Improve OVA manifest parsing
This series fixes and enhances parsing of the OVA manifest file. The changes are: - Added mandatory space to the regexp - Process all lines in the file, not just one - Warn on improperly formated lines - Support SHA256 hashes v1 -> v2: rebased on to master to make use of the Checksums module Tomáš Golembiovský (2): v2v: ova: fix checking of the manifest file v2v: ova: support SHA256
2016 Oct 05
0
[PATCH v2 2/2] v2v: ova: support SHA256 hashes in manifest
...\\))= \\([0-9a-fA-F]+\\)\r?" in + let rex = Str.regexp "\\(SHA1\\|SHA256\\)(\\(.*\\))= \\([0-9a-fA-F]+\\)\r?" in List.iter ( fun mf -> debug "Processing manifest %s" mf; @@ -142,13 +142,14 @@ object let rec loop () = let line = input_line chan in if Str.string_match rex line 0 then ( - let disk = Str.matched_group 1 line in - let expected = Str.matched_group 2 line in - let csum = Checksums.SHA1 expected in + let mode = Str.matched_group 1 line in + let disk = Str.mat...
2008 Jan 03
1
Iconv translit working in every situation… but the running app!
Hi all, I scourged the web, including this ML''s archives, and did not find an answer for this. I have the following code in my Rails app: require ''iconv'' ... @@converter = Iconv.new(''ASCII//TRANSLIT'', ''UTF-8'') ... result = @@converter.iconv(text.to_s).downcase ... Now, the facts: * Inbound text is indeed valid
2015 Mar 18
0
[PATCH 1/2] mllib: allow external_command to return on nonzero return value
...vm2_uuids uuid1 uuid2 = loop 0 0 (* Run an external command, slurp up the output as a list of lines. *) -let external_command ~prog cmd = +let external_command ~prog ?(ignore_error = false) cmd = let chan = Unix.open_process_in cmd in let lines = ref [] in (try while true do lines := input_line chan :: !lines done with End_of_file -> ()); let lines = List.rev !lines in let stat = Unix.close_process_in chan in - (match stat with - | Unix.WEXITED 0 -> () + match stat with + | Unix.WEXITED 0 -> + (* Command exited correctly, return its output *) + lines + | Unix...
2015 Jul 17
4
[PATCH v2 0/2] basic subscription-manager support in virt-customize
Hi, this is the v2 of a series introducing basic support for registering/attaching/unregistering RHEL guests using subscription-manager, so it is possible to do for example: $ virt-customize -a rhel-guest.qcow2 \ --sm-credentials user:file:/path/to/password-file --sm-register \ --sm-attach file:/path/to/pool-file \ --install pkg1 --install pkg2 .. \ --sm-remove --sm-unregister
2016 Oct 05
3
[PATCH v3 0/2] Improve OVA manifest parsing
This series fixes and enhances parsing of the OVA manifest file. The changes are: - Added mandatory space to the regexp - Process all lines in the file, not just one - Warn on improperly formated lines - Support SHA256 hashes v1 -> v2: rebased on to master to make use of the Checksums module v2 -> v3: - changed debug/warning messages in first patch according to Richard's suggestions
2016 Oct 05
4
[PATCH v4 0/2] Improve OVA manifest parsing
This series fixes and enhances parsing of the OVA manifest file. The changes are: - Added mandatory space to the regexp - Process all lines in the file, not just one - Warn on improperly formated lines - Support SHA256 hashes v1 -> v2: rebased on to master to make use of the Checksums module v2 -> v3: - changed debug/warning messages in first patch according to Richard's suggestions
2015 Aug 31
0
[PATCH 2/2] mllib: set --debug-gc as common option
...quot;, Arg.Unit set_debug_gc, " " ^ s_"Debug GC and memory allocations (internal)"; ] @ argspec in let argspec = let cmp (arg1, _, _) (arg2, _, _) = compare_command_line_args arg1 arg2 in @@ -778,7 +782,3 @@ let read_first_line_from_file filename = let line = input_line chan in close_in chan; line - -(** Install an exit hook to check gc consistency for --debug-gc *) -let set_debug_gc () = - at_exit (fun () -> Gc.compact()) diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 5d93b53..79032bc 100644 --- a/mllib/common_utils.mli +++ b/mllib/c...
2016 Sep 29
3
[PATCH 2/2] v2v: ova: support SHA256 hashes in manifest
...(.*\\))= \\([0-9a-fA-F]+\\)\r?" in + let rex = Str.regexp "SHA\\(1\\|256\\)(\\(.*\\))= \\([0-9a-fA-F]+\\)\r?" in List.iter ( fun mf -> debug "Processing manifest %s" mf; @@ -142,20 +142,23 @@ object let rec loop () = let line = input_line chan in if Str.string_match rex line 0 then ( - let disk = Str.matched_group 1 line in - let expected = Str.matched_group 2 line in - let cmd = sprintf "sha1sum %s" (quote (mf_folder // disk)) in + let sha_num = Str.matched_group 1 li...
2016 Nov 04
0
[PATCH 4/5] v2v: ova: don't extract files from OVA if it's not needed
...t ovf = @@ -152,6 +206,7 @@ object fun mf -> debug "processing manifest %s" mf; let mf_folder = Filename.dirname mf in + let mf_subfolder = subfolder mf_folder exploded in let chan = open_in mf in let rec loop () = let line = input_line chan in @@ -160,7 +215,11 @@ object let disk = Str.matched_group 2 line in let expected = Str.matched_group 3 line in let csum = Checksums.of_string mode expected in - try Checksums.verify_checksum csum (mf_folder // disk) + try +...
2016 Nov 12
0
[PATCH v2 4/5] v2v: ova: don't extract files from OVA if it's not needed
...t ovf = @@ -152,6 +253,7 @@ object fun mf -> debug "processing manifest %s" mf; let mf_folder = Filename.dirname mf in + let mf_subfolder = subfolder mf_folder exploded in let chan = open_in mf in let rec loop () = let line = input_line chan in @@ -160,7 +262,11 @@ object let disk = Str.matched_group 2 line in let expected = Str.matched_group 3 line in let csum = Checksums.of_string mode expected in - try Checksums.verify_checksum csum (mf_folder // disk) + try +...
2016 Oct 07
3
[PATCH v5 0/2] Improve OVA manifest parsing
This series fixes and enhances parsing of the OVA manifest file. The changes are: - Added mandatory space to the regexp - Process all lines in the file, not just one - Warn on improperly formated lines - Support SHA256 hashes v4 -> v5: - fix tests - change one test to include the SHA256 checksum Tomáš Golembiovský (2): v2v: ova: fix checking of the manifest file v2v: ova: support SHA256
2014 Oct 21
3
Re: [PATCH v5 1/7] tests: Introduce test harness for running tests.
...o111 <> 0 > + with Unix_error _ -> false I guess Unix.access might be better here. > +let relative_path_to_absolute path = > + let cmd = sprintf "unset CDPATH; cd %s && pwd" (Filename.quote path) in > + let chan = open_process_in cmd in > + let path = input_line chan in > + (match close_process_in chan with > + | WEXITED 0 -> () > + | WEXITED _ > + | WSIGNALED _ > + | WSTOPPED _ -> > + failwith (sprintf "failed to convert relative path to absolute path: %s" > + cmd) > + ); > + path Intere...
2015 Mar 18
5
[PATCH 0/2] [RFE] virt-builder should support download resume
This patchset adds support for resuming downloads in virt-builder. Partially downloaded file is not deleted on exit anymore. There is a check for partially downloaded image in cache directory based on its name. When found, download_to crafts appropriate options to continue its download. Maros Zatko (2): mllib: allow external_command to return [] on nonzero return value builder: support for
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.