search for: executable_not_found

Displaying 20 results from an estimated 45 matches for "executable_not_found".

2019 Jan 11
3
[PATCH 1/3] mlstdutils: add a very simple test for Std_utils.which
..." x)) ^ ")") let assert_equal_stringpair = assert_equal ~printer:(fun (x, y) -> sprintf "%S, %S" x y) +let assert_nonempty_string str = + if str = "" then + assert_failure (sprintf "Expected empty string, got '%s'" str) +let assert_raises_executable_not_found exe = + assert_raises (Executable_not_found exe) (fun () -> which exe) (* Test Std_utils.int_of_X and Std_utils.X_of_int byte swapping * functions. @@ -140,6 +145,12 @@ let test_string_chomp ctx = assert_equal_string "" (String.chomp "\n"); assert_equal_string &qu...
2016 Aug 02
2
[PATCH] mllib: move which and its exception from dib
...etions(-) diff --git a/dib/dib.ml b/dib/dib.ml index de4f242..87af4eb 100644 --- a/dib/dib.ml +++ b/dib/dib.ml @@ -297,7 +297,7 @@ $cmd \"$@\" (try let loc = which "dib-run-parts" in do_cp loc (destdir // "fake-bin") - with Tool_not_found _ -> + with Executable_not_found _ -> let fake_dib_run_parts = "\ #!/bin/sh echo \"Please install dib-run-parts on the host\" diff --git a/dib/utils.ml b/dib/utils.ml index f316264..a2046cb 100644 --- a/dib/utils.ml +++ b/dib/utils.ml @@ -21,8 +21,6 @@ open Common_utils open Printf -exception Tool_not...
2017 May 26
2
[PATCH 0/2] mllib: Export some more functions to the generator.
These functions are already linked to the generator, they're just not exported. Rich.
2018 Nov 19
2
[PATCH] common/mltools: Add a debug statement when we try to run a non-existent program.
.../mltools/tools_utils.ml b/common/mltools/tools_utils.ml index ad08d05eb..298d89b4d 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -420,9 +420,11 @@ and do_run ?(echo_cmd = true) ?stdout_fd ?stderr_fd args = Either (pid, app, stdout_fd, stderr_fd) with | Executable_not_found _ -> - Or 127 - | Unix.Unix_error (errcode, _, _) when errcode = Unix.ENOENT -> - Or 127 + debug "%s: executable not found" app; + Or 127 + | Unix.Unix_error (errcode, fn, _) when errcode = Unix.ENOENT -> + debug "%s: %s: executable not found" app fn...
2016 Aug 23
1
[PATCH] mllib: do not assume $PATH is set
Make 'which' gracefully handle the case where $PATH is not set (it will raise Executable_not_found, but that is the expected thing to do). Related to RHBZ#1367839. --- mllib/common_utils.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index fdca713..9210cf8 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@...
2018 Nov 20
1
[PATCH] v2v: -o openstack: Check openstack binary exists before running it.
...backends which want * to preallocate the storage. @@ -172,13 +175,20 @@ class output_openstack output_conn output_password output_storage object_get_string "uuid" json ) in + let error_unless_openstack_command_exists () = + try ignore (which openstack_binary) + with Executable_not_found _ -> + error (f_"no binary called ‘%s’ was found on the $PATH. We use this program to communicate with OpenStack so it must be installed to use this output mode.") + openstack_binary + in + (* We use this convenient wrapper around [Tools_utils.run_command] * for t...
2020 May 26
1
[v2v PATCH] vCenter: require curl in #precheck
...specialized for handling VMware vCenter over https. *) class input_libvirt_vcenter_https libvirt_conn input_conn input_password parsed_uri server guest = + + let error_unless_curl_command_exists () = + let curl_binary = "curl" in + try ignore (which curl_binary) + with Executable_not_found _ -> + error (f_"the ‘%s’ program is not available. It is needed to communicate with vCenter.") + curl_binary + in + object (self) inherit input_libvirt libvirt_conn ~input_conn guest val mutable dcPath = "" method precheck () = - error_if_l...
2017 Apr 06
1
[PATCH v2] builder: Allow GnuPG v2 or v1 to be used (RHBZ#1438939).
.....f20c0936c 100644 --- a/builder/cmdline.ml +++ b/builder/cmdline.ml @@ -87,7 +87,13 @@ let parse_cmdline () = let add_fingerprint arg = push_front arg fingerprints in let format = ref "" in - let gpg = ref "gpg" in + let gpg = + try which "gpg2" + with Executable_not_found _ -> + try which "gpg" + with Executable_not_found _ -> + "" in + let gpg = ref gpg in let list_format = ref List_entries.Short in let list_set_long () = list_format := List_entries.Long in diff --git a/builder/virt-builder.pod b/build...
2016 Sep 23
2
[PATCH 1/2] mllib: move remove_duplicates from v2v
Simple code motion. --- mllib/common_utils.ml | 9 +++++++++ mllib/common_utils.mli | 6 ++++++ v2v/utils.ml | 9 --------- v2v/utils.mli | 3 --- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 81d8202..78618f5 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -297,6 +297,15 @@ let sort_uniq
2017 Apr 07
1
[PATCH 1/2] mllib: add new Common_utils.run_commands
...errfd = get_fd Unix.stderr err in + if echo_cmd then + debug "%s" (stringify_args args); + let pid = Unix.create_process app (Array.of_list args) Unix.stdin + outfd errfd in + Some (i, pid, app, out, err) + with + | Executable_not_found _ -> + res.(i) <- 127; + None + | Unix.Unix_error (errcode, _, _) when errcode = Unix.ENOENT -> + res.(i) <- 127; + None + ) cmds in + let pids = filter_map (fun x -> x) pids in + let pids = ref pids in + while !pids <> [] do +...
2017 Jun 20
2
[PATCH v2 1/2] mllib: add new Common_utils.run_commands
...ut_chan in + let errfd = get_fd Unix.stderr stderr_chan in + if echo_cmd then + debug "%s" (stringify_args args); + let pid = Unix.create_process app (Array.of_list args) Unix.stdin + outfd errfd in + Either (pid, app, stdout_chan, stderr_chan) with - | Executable_not_found tool -> 127 - | Unix.Unix_error (errcode, _, _) when errcode = Unix.ENOENT -> 127 + | Executable_not_found _ -> + Or 127 + | Unix.Unix_error (errcode, _, _) when errcode = Unix.ENOENT -> + Or 127 + +and do_teardown app outfd errfd exitstat = + may Unix.close outfd; + may Unix...
2016 Aug 02
0
[PATCH] mllib: check for executable existance in run_command (RHBZ#1362357)
...i + | Unix.WSIGNALED i -> + error (f_"external command '%s' killed by signal %d") + (stringify_args args) i + | Unix.WSTOPPED i -> + error (f_"external command '%s' stopped by signal %d") + (stringify_args args) i + with + | Executable_not_found tool -> 127 + | Unix.Unix_error (errcode, _, _) when errcode = Unix.ENOENT -> 127 let shell_command ?(echo_cmd = true) cmd = if echo_cmd then -- 2.7.4
2016 Sep 23
0
[PATCH 2/2] dib: use remove_duplicates instead of own code
...ils.ml +++ b/dib/utils.ml @@ -91,10 +91,6 @@ let digit_prefix_compare a b = let do_mkdir dir = mkdir_p dir 0o755 -let rec remove_dups = function - | [] -> [] - | x :: xs -> x :: (remove_dups (List.filter ((<>) x) xs)) - let require_tool tool = try ignore (which tool) with Executable_not_found tool -> -- 2.7.4
2017 Mar 07
0
[PATCH v4 7/9] dib: move do_cp to mllib.Commun_utils
...| 4 ---- mllib/common_utils.ml | 5 +++++ mllib/common_utils.mli | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dib/utils.ml b/dib/utils.ml index da5e738ad..e769ebe28 100644 --- a/dib/utils.ml +++ b/dib/utils.ml @@ -95,10 +95,6 @@ let require_tool tool = with Executable_not_found tool -> error (f_"%s needed but not found") tool -let do_cp src destdir = - let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in - if run_command cmd <> 0 then exit 1 - let ensure_trailing_newline str = if String.length str > 0 &&...
2018 Nov 20
0
Re: [PATCH] common/mltools: Add a debug statement when we try to run a non-existent program.
...tools/tools_utils.ml > index ad08d05eb..298d89b4d 100644 > --- a/common/mltools/tools_utils.ml > +++ b/common/mltools/tools_utils.ml > @@ -420,9 +420,11 @@ and do_run ?(echo_cmd = true) ?stdout_fd ?stderr_fd args = > Either (pid, app, stdout_fd, stderr_fd) > with > | Executable_not_found _ -> > - Or 127 > - | Unix.Unix_error (errcode, _, _) when errcode = Unix.ENOENT -> > - Or 127 > + debug "%s: executable not found" app; > + Or 127 > + | Unix.Unix_error (errcode, fn, _) when errcode = Unix.ENOENT -> > + debug "%s: %s...
2019 Jan 08
2
[PATCH] v2v: -o rhv-upload: Allow configure commands to set the Python version.
...Is SELinux enabled and enforcing on the host? *) let have_selinux = 0 = Sys.command "getenforce 2>/dev/null | grep -isq Enforcing" in + (* Check Python interpreter found. *) + let error_unless_python_interpreter_found () = + try ignore (which python_intepreter) + with Executable_not_found _ -> + error (f_"no python binary called ‘%s’ can be found on the $PATH") + python_intepreter + in + (* Check that the 'ovirtsdk4' Python module is available. *) let error_unless_ovirtsdk4_module_available () = - let res = run_command [ Python_script.p...
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
...o + keys management, i.e. [--echo-keys] and [--keys-from-stdin]. + Returns a new [Getopt.t] handle. *) val compare_version : string -> string -> int @@ -390,3 +393,8 @@ val which : string -> string (** Return the full path of the specified executable from [$PATH]. Throw [Executable_not_found] if not available. *) + +val inspect_decrypt : Guestfs.guestfs -> unit +(** Simple implementation of decryption: look for any [crypto_LUKS] + partitions and decrypt them, then rescan for VGs. This only works + for Fedora whole-disk encryption. *) -- 2.7.4
2019 Apr 03
1
[PATCH] UNTESTED v2v: openstack: Read server-id from metadata service.
Random old patch that I had in my queue. Posting it as a backup, it is still untested. Rich.
2017 Nov 21
2
[PATCH REPOST 1/2] common/mlstdutils: Add return statement.
No change, just reposting without the "for discussion" tag. I think we should allow this as it seems like a nice coding style for a limited subset of imperative-style code. Rich.
2017 Nov 05
2
[PATCH 0/2] (mainly for discussion) Add ‘return’ statement.
When rewriting the heavily imperative original inspection code, I longed for a ‘return’ statement so I could keep the new code as close as possible to the original. OCaml of course does not have such a statement, but it's relatively simply to implement it in the language. The first patch does so, and the second patch rewrites a sample of the inspection code to use it. Rich.