search for: parse_file

Displaying 20 results from an estimated 56 matches for "parse_file".

2017 Feb 10
0
[PATCH v3 03/10] mllib: add Xml.parse_file helper
...tring. --- mllib/xml.ml | 4 ++++ mllib/xml.mli | 3 +++ 2 files changed, 7 insertions(+) diff --git a/mllib/xml.ml b/mllib/xml.ml index e67245188..78e75b8f2 100644 --- a/mllib/xml.ml +++ b/mllib/xml.ml @@ -67,6 +67,10 @@ let parse_memory xml = Gc.finalise free_docptr docptr; docptr +let parse_file file = + let xml = Common_utils.read_whole_file file in + parse_memory xml + external _copy_doc : docptr -> recursive:bool -> docptr = "mllib_xml_copy_doc" let copy_doc docptr ~recursive = let copy = _copy_doc docptr ~recursive in diff --git a/mllib/xml.mli b/mllib/xml.mli in...
2020 Jan 17
1
[v2v PATCH] -i ova: use Xml.parse_file for the OVF
...b/v2v/parse_ovf_from_ova.ml index 27761d23..5acf7070 100644 --- a/v2v/parse_ovf_from_ova.ml +++ b/v2v/parse_ovf_from_ova.ml @@ -36,8 +36,7 @@ type ovf_disk = { } let xpathctx_of_ovf ovf_filename = - let xml = read_whole_file ovf_filename in - let doc = Xml.parse_memory xml in + let doc = Xml.parse_file ovf_filename in (* Handle namespaces. *) let xpathctx = Xml.xpath_new_context doc in -- 2.24.1
2017 Oct 11
2
[PATCH] v2v: -i vmx: Refuse to load a disk image by accident.
...what the file is. --- v2v/parse_vmx.ml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/v2v/parse_vmx.ml b/v2v/parse_vmx.ml index 65d5a0edd..f6c34e2cf 100644 --- a/v2v/parse_vmx.ml +++ b/v2v/parse_vmx.ml @@ -268,6 +268,18 @@ let remove_vmx_escapes str = (* Parsing. *) let rec parse_file vmx_filename = + (* One person pointed -i vmx at the VMDK file, resulting in an out + * of memory error. Avoid this narrow case. + *) + let () = + let cmd = sprintf "file -b %s ||:" (quote vmx_filename) in + let out = external_command cmd in + match out with + | line ::...
2017 Oct 09
1
Re: [PATCH v11 6/6] New tool: virt-builder-repository
...on type. > +let osinfo_ids = ref None > + > +let osinfo_get_short_ids () = > + match !osinfo_ids with > + | Some ids -> ids > + | None -> ( > + let set = ref StringSet.empty in > + Osinfo.iterate_db ( > + fun filepath -> > + let doc = Xml.parse_file filepath in > + let xpathctx = Xml.xpath_new_context doc in > + let nodes = xpath_get_nodes xpathctx "/libosinfo/os/short-id" in > + List.iter ( > + fun node -> > + let id = Xml.node_as_string node in > + set := Stri...
2017 Oct 11
1
Re: [PATCH] v2v: -i vmx: Refuse to load a disk image by accident.
...+) > > > > diff --git a/v2v/parse_vmx.ml b/v2v/parse_vmx.ml > > index 65d5a0edd..f6c34e2cf 100644 > > --- a/v2v/parse_vmx.ml > > +++ b/v2v/parse_vmx.ml > > @@ -268,6 +268,18 @@ let remove_vmx_escapes str = > > > > (* Parsing. *) > > let rec parse_file vmx_filename = > > + (* One person pointed -i vmx at the VMDK file, resulting in an out > > + * of memory error. Avoid this narrow case. > > + *) > > + let () = > > + let cmd = sprintf "file -b %s ||:" (quote vmx_filename) in > > + let out...
2017 Feb 07
0
[PATCH v2 2/7] Move xml and xpath_helpers OCAML code to mllib
...ory" +external _parse_memory : string -> docptr = "mllib_xml_parse_memory" let parse_memory xml = let docptr = _parse_memory xml in Gc.finalise free_docptr docptr; docptr -external _copy_doc : docptr -> recursive:bool -> docptr = "v2v_xml_copy_doc" +let parse_file file = + let xml = Common_utils.read_whole_file file in + parse_memory xml + +external _copy_doc : docptr -> recursive:bool -> docptr = "mllib_xml_copy_doc" let copy_doc docptr ~recursive = let copy = _copy_doc docptr ~recursive in Gc.finalise free_docptr copy; copy -e...
2017 Sep 18
0
[PATCH v9 4/7] builder: add Index.write_entry function
...e:None ~tmpdir + +(* Utils. *) +let write_entries file entries = + let chan = open_out (tmpdir // file) in + List.iter ( + fun (entry) -> + Index_parser.write_entry chan entry; + ) entries; + close_out chan + +let read_file file = + read_whole_file (tmpdir // "out") + +let parse_file file = + let source = { Sources.name = "input"; + uri = tmpdir // file; + gpgkey = Utils.No_Key; + proxy = Curl.SystemProxy; + format = Sources.FormatNative } in + let entries = Index_parser.get_index ~downloader:dummy_down...
2017 Oct 27
0
[PATCH v11 6/8] builder: add Index.write_entry function
...~cache:None ~tmpdir + +(* Utils. *) +let write_entries file entries = + let chan = open_out (tmpdir // file) in + List.iter (Index_parser.write_entry chan) entries; + close_out chan + +let read_file file = + read_whole_file (tmpdir // "out") + +let parse_file file = + let source = { Sources.name = "input"; + uri = tmpdir // file; + gpgkey = Utils.No_Key; + proxy = Curl.SystemProxy; + format = Sources.FormatNative } in + let entries = Index_parser.get_index ~downloader:dummy_down...
2017 Oct 05
0
[PATCH v11 4/6] builder: add Index.write_entry function
...e:None ~tmpdir + +(* Utils. *) +let write_entries file entries = + let chan = open_out (tmpdir // file) in + List.iter ( + fun (entry) -> + Index_parser.write_entry chan entry; + ) entries; + close_out chan + +let read_file file = + read_whole_file (tmpdir // "out") + +let parse_file file = + let source = { Sources.name = "input"; + uri = tmpdir // file; + gpgkey = Utils.No_Key; + proxy = Curl.SystemProxy; + format = Sources.FormatNative } in + let entries = Index_parser.get_index ~downloader:dummy_down...
2007 Apr 16
0
7 commits - libswfdec/swfdec_codec_gst.c libswfdec/swfdec_font.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_shape.c libswfdec/swfdec_shape.h libswfdec/swfdec_sprite.c
libswfdec/swfdec_codec_gst.c | 2 libswfdec/swfdec_font.c | 4 libswfdec/swfdec_js_movie.c | 39 ++++++++- libswfdec/swfdec_morph_movie.c | 18 ++-- libswfdec/swfdec_pattern.c | 130 +++++++++++++++++++------------ libswfdec/swfdec_pattern.h | 16 ++- libswfdec/swfdec_shape.c | 99 +++++++++++++----------- libswfdec/swfdec_shape.h | 11 +-
2017 Dec 08
0
[PATCH v2 2/2] v2v: -i vmx: Enhance VMX support with ability to use ‘-it ssh’ transport.
...oesn't pass the SSH_AUTH_SOCK environment variable to qemu you must set this environment variable:\n\nexport LIBGUESTFS_BACKEND=direct\n\nand then rerun the virt-v2v command."); + error_if_no_ssh_agent () method source () = - (* Parse the VMX file. *) - let vmx = Parse_vmx.parse_file vmx_filename in + let vmx_source = vmx_source_of_arg input_transport arg in + + (* If the transport is SSH, fetch the file from remote, else + * parse it from local. + *) + let vmx = + match vmx_source with + | File filename -> Parse_vmx.parse_file filename + | SS...
2017 Oct 11
0
Re: [PATCH] v2v: -i vmx: Refuse to load a disk image by accident.
...++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/v2v/parse_vmx.ml b/v2v/parse_vmx.ml > index 65d5a0edd..f6c34e2cf 100644 > --- a/v2v/parse_vmx.ml > +++ b/v2v/parse_vmx.ml > @@ -268,6 +268,18 @@ let remove_vmx_escapes str = > > (* Parsing. *) > let rec parse_file vmx_filename = > + (* One person pointed -i vmx at the VMDK file, resulting in an out > + * of memory error. Avoid this narrow case. > + *) > + let () = > + let cmd = sprintf "file -b %s ||:" (quote vmx_filename) in > + let out = external_command cmd in >...
2017 Dec 08
1
Re: [PATCH v2 2/2] v2v: -i vmx: Enhance VMX support with ability to use ‘-it ssh’ transport.
On Friday, 8 December 2017 17:02:30 CET Richard W.M. Jones wrote: > This enhances the existing VMX input support allowing it to be > used over SSH to the ESXi server. > > The original command (for local .vmx files) was: > > $ virt-v2v -i vmx guest.vmx -o local -os /var/tmp > > Adding ‘-it ssh’ and using an SSH remote path gives the new syntax: > > $ virt-v2v \
2012 Oct 18
0
unexpected return (LocalJumpError) only when executing this code within autoloaded classes?
...path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/rack-1.4.1/lib/rack/builder.rb.51 #<Binding:0x007ff7b14093f8> Rack::Builder initialize return /path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/rack-1.4.1/lib/rack/builder.rb.40 #<Binding:0x007ff7b1408ac0> Rack::Builder parse_file return /path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/rack-1.4.1/lib/rack/server.rb.200 #<Binding:0x007ff7b1408840> Rack::Server app return /path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/railties-3.2.8/lib/rails/commands/server.rb.46 #<Binding:0x007ff7b1408598...
2010 Nov 12
0
wrong number of arguments (0 for 1) (ArgumentError)
...from C:/forex/config.ru:1:in `new'' from C:/forex/config.ru:1:in `<main>'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:...
2012 Feb 20
0
Cannot start rails server: Please install the adapter: `gem install activerecord--adapter`
...' from /home/al3xa/rails/sorcery/config.ru:1:in `new'' from /home/al3xa/rails/sorcery/config.ru:1:in `<main>'' from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'' from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'' from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'' from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands/server.rb:46:in `app'' from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'' fro...
2012 Oct 17
2
autolog: set_trace_func without all the typing
If it helps anyone developing Rails, apps, or gems, I wrote a shortcut for set_trace_func, so next time you want to just add a line before and after some function you are trying to debug you can have Ruby temporarily output every line, method, etc. executed. Also, it lets you define the format, use other loggers, etc. via a proc/lambda define, since you might not like the default format.
2017 Dec 08
4
[PATCH v2 0/2] v2v: Add -it vddk and -it ssh flags.
The first patch was previously posted here: https://www.redhat.com/archives/libguestfs/2017-December/msg00018.html That patch hasn't changed except that I made the ‘input_transport’ variable type-safe. The second patch adds a significant new mode for liberating data from VMware: the ability to copy VMs over SSH directly from ESXi hypervisors. Although this requires enabling SSH access (a
2008 Jan 02
0
4 commits - libswfdec/Makefile.am libswfdec/swfdec_movie.c libswfdec/swfdec_shape_parser.c test/dump.c test/trace
libswfdec/Makefile.am | 2 libswfdec/swfdec_movie.c | 24 +++++- libswfdec/swfdec_shape_parser.c | 4 - test/dump.c | 3 test/trace/Makefile.am | 9 ++ test/trace/movieclip-version-5.swf |binary test/trace/movieclip-version-5.swf.trace | 111 +++++++++++++++++++++++++++++++
2017 Apr 11
4
v2v: Implement -i vmx to read VMware vmx files directly (RHBZ#1441197).
https://bugzilla.redhat.com/show_bug.cgi?id=1441197