search for: is_relative

Displaying 20 results from an estimated 37 matches for "is_relative".

2016 Aug 08
1
[PATCH] sparsify, v2v: use Common_utils.absolute_path
...ex 3eb0d5b..523d612 100644 --- a/sparsify/cmdline.ml +++ b/sparsify/cmdline.ml @@ -142,11 +142,7 @@ read the man page virt-sparsify(1). (* The input disk must be an absolute path, so we can store the name * in the overlay disk. *) - let indisk = - if not (Filename.is_relative indisk) then - indisk - else - Sys.getcwd () // indisk in + let indisk = absolute_path indisk in (* Check the output is not a char special (RHBZ#1056290). *) if is_char_device outdisk then diff --git a/v2v/input_disk.ml b/v2v/input_disk.ml index d56c476...
2017 Mar 22
2
Re: [PATCH 4/5] dib: require a Python interpreter
...@ -246,6 +252,19 @@ read the man page virt-dib(1). > if elements = [] then > error (f_"at least one distribution root element must be specified"); > > + let python = > + match python with > + | Some exe -> > + let p = > + if Filename.is_relative exe then IIUC what you mean here is "the 'exe' filename doesn't contain any slashes"? That isn't what is written above. > + get_required_tool exe > + else ( > + Unix.access exe [Unix.X_OK]; > + exe > + ) in > +...
2006 Sep 07
1
test_metaflac fails in make check for flac 1.1.2 after --add-padding is performed
...l_gnuplot = 1}, options= {common = {continue_through_decode_errors = 0, replaygain_synthesis_spec = {apply = 0, use_album_gain = 1, limiter = RGSS_LIMIT__HARD, noise_shaping = NOISE_SHAPING_LOW, preamp = 0}, is_ogg = 0, use_first_serial_number = 1, serial_number = 0, skip_specification = {is_relative = 0, value_is_samples = 1, value = {seconds = 0, samples = 0}}, until_specification = {is_relative = 0, value_is_samples = 1, value = {seconds = 0, samples = 0}}, has_cue_specification = 0, cue_specification = {has_start_point = -1207954168, has_end_point = 0, start_track = 3086395392, start_index...
2006 Jun 04
0
Re: flac with >4GB raw still does not work (CVS)
...(infile=0x833d430, infilesize=14938537984, infilename=0x833d3e0 "/mnt/sda/Sound/Recording/2006-06-02/a.raw", outfilename=0xbfd86800 "b.flac", lookahead=0xbfd859d0 "?\233\006\b?\233\006\b\bZ?0?3\b", lookahead_length=0, options= {common = {skip_specification = {is_relative = 0, value_is_samples = 1, value = {seconds = 0, samples = 0}}, until_specification = {is_relative = 0, value_is_samples = 1, value = {seconds = 0, samples = 0}}, verify = 0, use_ogg = 0, serial_number = 1139381067, lax = 0, do_mid_side = 0, loose_mid_side = 0, do_exhaustive_model_search = 0, do_es...
2006 Jun 03
2
flac with >4GB raw still does not work (CVS)
I'm attempting to flac a 18GB raw file, and as per 1328191 I compiled CVS, when it gets to 4GB it doesn't continue. I've tried stracing and get no output after a certain point. I also have tried oggflac and it is no different. I configured with no options or special CFLAGS and this is on a x86 machine. Is there anything special I need to do to get this to work? I have also tried with
2006 Aug 28
2
test_metaflac fails in make check for flac 1.1.2 after --add-padding is performed
doing "make check" on flac-1.1.2, I get a segmentation fault ././test_metaflac.sh: line 51: 17370 Segmentation fault flac $* when running this portion of the test/test_metaflac.sh script: (set -x && run_metaflac --preserve-modtime --add-padding=12345 $flacfile) check_exit check_flac <---------------- where the segfault happens All other tests in
2017 Apr 07
1
[PATCH 1/2] mllib: add new Common_utils.run_commands
...) 0 in + let get_fd default = function + | None -> + default + | Some fd -> + Unix.set_close_on_exec fd; + fd + in + let pids = + mapi ( + fun i (args, out, err) -> + let app = List.hd args in + try + let app = + if Filename.is_relative app then which app + else (Unix.access app [Unix.X_OK]; app) in + let outfd = get_fd Unix.stdout out in + let errfd = get_fd Unix.stderr err in + if echo_cmd then + debug "%s" (stringify_args args); + let pid = Unix.create_process...
2016 Aug 02
0
[PATCH] mllib: check for executable existance in run_command (RHBZ#1362357)
..."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 + let app = List.hd args in + try + let app = + if Filename.is_relative app then which app + else (Unix.access app [Unix.X_OK]; app) in + let pid = + Unix.create_process app (Array.of_list args) Unix.stdin + Unix.stdout Unix.stderr in + let _, stat = Unix.waitpid [] pid in + match stat with + | Unix.WEXITED i -> i + | Unix.WSIGNALED i...
2017 Mar 22
0
Re: [PATCH 4/5] dib: require a Python interpreter
...rt-dib(1). > > if elements = [] then > > error (f_"at least one distribution root element must be specified"); > > > > + let python = > > + match python with > > + | Some exe -> > > + let p = > > + if Filename.is_relative exe then > > IIUC what you mean here is "the 'exe' filename doesn't contain > any slashes"? That isn't what is written above. Yes, sort of. What about something like: let p = try ignore (String.find exe Filename.dir_sep); Unix.access exe [Un...
2019 Jan 11
0
[PATCH 3/3] OCaml: use the new behaviour of Std_utils.which
...on/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index 3c7e1b846..24641369e 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -408,9 +408,7 @@ and do_run ?(echo_cmd = true) ?stdout_fd ?stderr_fd args = fd in try - let app = - if Filename.is_relative app then which app - else (Unix.access app [Unix.X_OK]; app) in + let app = which app in let outfd = get_fd Unix.stdout stdout_fd in let errfd = get_fd Unix.stderr stderr_fd in if echo_cmd then diff --git a/dib/cmdline.ml b/dib/cmdline.ml index 220350d9d..11ff57341 100644 ---...
2017 Mar 22
7
[PATCH 0/5] dib: initial work to support d-i-b 2.0
Hi, this series start to implement some of the changes needed to support d-i-b 2.0; normal VM distro builds seem to work correctly, ramdisk builds are still broken and require more efforts. Thanks, Pino Toscano (5): dib: implement get_image_element_array stuff dib: export IMAGE_BLOCK_DEVICE_WITHOUT_PART dib: extract get_required_tool out of require_tool dib: require a Python interpreter
2015 Jan 16
2
[PATCH 1/2] mllib: add simple qemu filename sanitizing function
...mon_utils.mli | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index b143710..4d3bf95 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -603,3 +603,16 @@ let is_directory path = let absolute_path path = if not (Filename.is_relative path) then path else Sys.getcwd () // path + +(* Sanitizes a filename for passing it safely to qemu/qemu-img. + * + * If the filename is something like "file:foo" then qemu-img will + * try to interpret that as "foo" in the file:/// protocol. To + * avoid that, if the path i...
2016 Feb 18
0
[PATCH 3/3] Add and use an helper error function
...it a/src/supermin.ml b/src/supermin.ml index bbb1dba..b0532e5 100644 --- a/src/supermin.ml +++ b/src/supermin.ml @@ -54,10 +54,8 @@ let main () = * This is untested and will break in some way or another later, so * better to die now with a meaningful error message. *) - if try Filename.is_relative (getenv "TMPDIR") with Not_found -> false then ( - eprintf "supermin: error: environment variable $TMPDIR must be an absolute path\n"; - exit 1 - ); + if try Filename.is_relative (getenv "TMPDIR") with Not_found -> false then + error "error: envir...
2017 Mar 22
0
[PATCH 4/5] dib: require a Python interpreter
...[] && machine_readable then ( @@ -246,6 +252,19 @@ read the man page virt-dib(1). if elements = [] then error (f_"at least one distribution root element must be specified"); + let python = + match python with + | Some exe -> + let p = + if Filename.is_relative exe then + get_required_tool exe + else ( + Unix.access exe [Unix.X_OK]; + exe + ) in + Some p + | None -> None in + { debug = debug; basepath = basepath; elements = elements; excluded_elements = excluded_elements; element_paths = element_...
2019 Jan 11
3
[PATCH 1/3] mlstdutils: add a very simple test for Std_utils.which
--- common/mlstdutils/std_utils_tests.ml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/mlstdutils/std_utils_tests.ml b/common/mlstdutils/std_utils_tests.ml index 81f512cbf..f7b0247a4 100644 --- a/common/mlstdutils/std_utils_tests.ml +++ b/common/mlstdutils/std_utils_tests.ml @@ -29,6 +29,11 @@ let assert_equal_int = assert_equal ~printer:(fun x -> string_of_int x)
2016 Aug 02
2
[PATCH] mllib: move which and its exception from dib
Rename it from "tool" to "executable" in the process, but otherwise it is just code motion (with minimal adjustments in dib). --- dib/dib.ml | 2 +- dib/utils.ml | 16 +--------------- mllib/common_utils.ml | 14 ++++++++++++++ mllib/common_utils.mli | 9 +++++++++ 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/dib/dib.ml b/dib/dib.ml
2017 Dec 08
0
[PATCH v2 2/2] v2v: -i vmx: Enhance VMX support with ability to use ‘-it ssh’ transport.
...h, which is - * also useful because it means we won't have any paths that - * could be misinterpreted by qemu. + * This constructs a QEMU URI of the filename relative to the + * vmx file (which might be remote over SSH). *) -and qemu_uri_of_filename vmx_filename filename = - if not (Filename.is_relative filename) then - filename - else ( - let dir = Filename.dirname (absolute_path vmx_filename) in - dir // filename - ) +and qemu_uri_of_filename vmx_source filename = + match vmx_source with + | File vmx_filename -> + (* Always ensure this returns an absolute path to avoid +...
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
2017 Jun 20
2
[PATCH v2 1/2] mllib: add new Common_utils.run_commands
...| Or code -> + code + +and do_run ?(echo_cmd = true) ?stdout_chan ?stderr_chan args = let app = List.hd args in + let get_fd default = function + | None -> + default + | Some fd -> + Unix.set_close_on_exec fd; + fd + in try let app = if Filename.is_relative app then which app else (Unix.access app [Unix.X_OK]; app) in - let pid = - Unix.create_process app (Array.of_list args) Unix.stdin - Unix.stdout Unix.stderr in - let _, stat = Unix.waitpid [] pid in - match stat with - | Unix.WEXITED i -> i - | Unix.WSIGNALED i...
2014 Mar 11
21
[PATCH v2 00/18] Add discard support.
This still isn't working at the moment. See: http://marc.info/?t=139457409300003&r=1&w=2 This set of patches: - Adds new APIs to support discard in libguestfs. - Adds discard support to virt-format. - Adds discard support to virt-sysprep. - Implements virt-sparsify --in-place. Rich.