search for: check_suffix

Displaying 20 results from an estimated 63 matches for "check_suffix".

2017 Mar 13
0
[PATCH 1/2] v2v: -i ova: Hoist utility functions to the top of the file.
...cking %s, see earlier error messages") file + +(* Untar only ovf and manifest from the archive *) +let untar_metadata file outdir = + let files = external_command (sprintf "tar -tf %s" (Filename.quote file)) in + let files = + filter_map ( + fun f -> + if Filename.check_suffix f ".ovf" || + Filename.check_suffix f ".mf" then Some f + else None + ) files in + untar ~paths:files file outdir + +(* Find files in [dir] ending with [ext]. *) +let find_files dir ext = + let rec loop = function + | [] -> [] + | dir :: rest ->...
2014 Oct 21
3
Re: [PATCH v5 1/7] tests: Introduce test harness for running tests.
...+ (1, 0, 0, 0, 1) > + ) > + else ( > + set_up_environment (); > + > + (* If it's a C program, and we're valgrinding, then we run the > + * C program under valgrind directly. > + *) > + let is_program = > + not (Filename.check_suffix test ".pl") && > + not (Filename.check_suffix test ".sh") in I think this should be extended to .lua files as well. > + (* Run the tests. *) > + let total, successful, failed, timedout, skipped = > + match start_dir with > + | TopDir ->...
2014 Oct 24
0
Re: [PATCH v5 1/7] tests: Introduce test harness for running tests.
...> + else ( > > + set_up_environment (); > > + > > + (* If it's a C program, and we're valgrinding, then we run the > > + * C program under valgrind directly. > > + *) > > + let is_program = > > + not (Filename.check_suffix test ".pl") && > > + not (Filename.check_suffix test ".sh") in > > I think this should be extended to .lua files as well. Yeah, and more. I've not implemented the other bindings tests yet. I'll fix the other stuff in the next patch. Rich....
2016 Aug 08
1
[PATCH v2] v2v: disk: strip only common extension (RHBZ#1365005)
...ffix), only if it's one usually + * used for disk images. *) + let suffixes = [ + ".img"; ".qcow2"; ".raw"; ".vmdk"; + "-sda"; + ] in + let rec loop = function + | suff :: xs -> + if Filename.check_suffix name suff then + Filename.chop_suffix name suff + else + loop xs + | [] -> name + in + loop suffixes in if name = "" then error (f_"-i disk: invalid input filename (%s)") disk; -- 2.7.4
2016 Sep 09
0
[PATCH 1/2] v2v: -i disk: Move code that creates name from disk to separate module.
...ffix), only if it's one usually - * used for disk images. *) - let suffixes = [ - ".img"; ".qcow2"; ".raw"; ".vmdk"; - "-sda"; - ] in - let rec loop = function - | suff :: xs -> - if Filename.check_suffix name suff then - Filename.chop_suffix name suff - else - loop xs - | [] -> name - in - loop suffixes in - if name = "" then - error (f_"-i disk: invalid input filename (%s)") disk; + let name = name_from_disk disk in...
2016 Nov 21
2
Re: [PATCH v2 4/5] v2v: ova: don't extract files from OVA if it's not needed
...l file outdir = I'd rename this as "untar_metadata", as it seems a better fitting name. YMMV. > + let files = > + external_command (sprintf "tar -tf %s" (Filename.quote file)) in > + List.iter (fun f -> > + if Filename.check_suffix f ".ovf" || > + Filename.check_suffix f ".mf" then > + untar ~path:f file outdir > + ) files in ... i.e. here: this can be changed to: let files = filter_map ( fun f -> if Filename.check_suffix f ".ovf&q...
2017 Mar 13
4
[PATCH 0/2] v2v: -i ova: A couple of cleanup patches.
A couple of patches cleaning up the -i ova code. These are both just refactoring (or should be at any rate). The second patch is best viewed with 'git show -w' to exclude whitespace changes. Rich.
2016 Sep 09
5
[PATCH 0/2] v2v: -i ova: Derive the name from the OVA filename.
Don't use "default", choose a better default name if <Name> is not present in the OVF. Rich.
2016 Nov 12
0
[PATCH v2 4/5] v2v: ova: don't extract files from OVA if it's not needed
...ct tmpfile in + (* Untar only ovf and manifest from the archive *) + let untar_partial file outdir = + let files = + external_command (sprintf "tar -tf %s" (Filename.quote file)) in + List.iter (fun f -> + if Filename.check_suffix f ".ovf" || + Filename.check_suffix f ".mf" then + untar ~path:f file outdir + ) files in + + let qemu_img_version () = + let cmd = "qemu-img --version" in + let lines = external_command cmd in + ma...
2016 Feb 17
0
[PATCH supermin v2 1/4] init: Uncompress modules before adding them to the mini initrd.
...run_command cmd; + (* Uncompress the module, if the name ends in .xz or .gz. *) + let basename = Filename.basename modl in + let basename = + let len = String.length basename in + if Config.unxz <> "no" && Filename.check_suffix basename ".xz" + then ( + let cmd = sprintf "%s %s" + (quote Config.unxz) + (quote (initdir // basename)) in + run_command cmd; + String.sub basename 0 (len-3) +...
2019 Mar 26
0
[PATCH 1/3] v2v: linux: add helper functions for pkg arch and extension
...100644 --- a/v2v/linux.ml +++ b/v2v/linux.ml @@ -179,3 +179,24 @@ let is_package_manager_save_file filename = (* Recognized suffixes of package managers. *) let suffixes = [ ".dpkg-old"; ".dpkg-new"; ".rpmsave"; ".rpmnew"; ] in List.exists (Filename.check_suffix filename) suffixes + +let binary_package_extension { i_package_format = package_format } = + match package_format with + | "deb" -> "deb" + | "rpm" -> "rpm" + | format -> + error (f_"don’t know what is the extension of binary packages usi...
2016 Feb 17
2
[PATCH supermin 0/2] Allow an alternate libc to be used for init.
Allow an alternate libc, such as dietlibc, to be used for the init binary in the supermin appliance. Rich.
2016 Nov 12
9
[PATCH v2 0/5] Import directly from OVA tar archive if possible
This series is related to the problem of inefficient import of OVA files. The needed enhancements of QEMU were merged into the codebase and should be available in QEMU 2.8. From there we can use 'size' and 'offset' options in raw driver to tell QEMU to use only subset of a file as an image. The patch set is more or less complete. The only outstanding issue is the missing detection
2019 Mar 26
7
[PATCH 0/3] v2v: improve RHV guest tools installation
This series slightly improves the way qemu-ga is installed from the RHV Tools ISO, simplifying the feedback to the user. Patch #3 sort of conflicts with patch #2 of a related series by Tomáš Golembiovský: https://www.redhat.com/archives/libguestfs/2019-February/msg00016.html Pino Toscano (3): v2v: linux: add helper functions for pkg arch and extension v2v: try to pick the right arch for
2017 Sep 12
0
[PATCH v8 1/7] ocaml osinfo database iterator
...ory fn) entries + +and read_osinfo_db_flat fn path = + debug "osinfo: loading flat database from %s" path; + read_osinfo_db_directory fn path + +and read_osinfo_db_directory fn path = + let entries = Array.to_list (Sys.readdir path) in + let entries = List.filter (fun x -> Filename.check_suffix x ".xml") entries in + let entries = List.map ((//) path) entries in + let entries = List.filter is_regular_file entries in + List.iter fn entries + diff --git a/builder/osinfo.mli b/builder/osinfo.mli new file mode 100644 index 000000000..949d776a9 --- /dev/null +++ b/builder/osinfo.m...
2017 Sep 18
0
[PATCH v9 1/7] ocaml osinfo database iterator
...ory fn) entries + +and read_osinfo_db_flat fn path = + debug "osinfo: loading flat database from %s" path; + read_osinfo_db_directory fn path + +and read_osinfo_db_directory fn path = + let entries = Array.to_list (Sys.readdir path) in + let entries = List.filter (fun x -> Filename.check_suffix x ".xml") entries in + let entries = List.map ((//) path) entries in + let entries = List.filter is_regular_file entries in + List.iter fn entries + diff --git a/builder/osinfo.mli b/builder/osinfo.mli new file mode 100644 index 000000000..949d776a9 --- /dev/null +++ b/builder/osinfo.m...
2017 Oct 27
0
[PATCH v11 2/8] builder: add simple OCaml osinfo-db reader
...+and read_osinfo_db_flat path = + debug "osinfo: loading flat database from %s" path; + read_osinfo_db_directory path + +and read_osinfo_db_directory path = + let entries = Sys.readdir path in + let entries = Array.to_list entries in + let entries = List.filter (fun x -> Filename.check_suffix x ".xml") entries in + let entries = List.map ((//) path) entries in + let entries = List.filter is_regular_file entries in + entries diff --git a/builder/osinfo.mli b/builder/osinfo.mli new file mode 100644 index 000000000..fa179509d --- /dev/null +++ b/builder/osinfo.mli @@ -0,0 +1,2...
2017 Sep 20
0
[PATCH v10 1/6] builder: add simple OCaml osinfo-db reader
...ory fn) entries + +and read_osinfo_db_flat fn path = + debug "osinfo: loading flat database from %s" path; + read_osinfo_db_directory fn path + +and read_osinfo_db_directory fn path = + let entries = Array.to_list (Sys.readdir path) in + let entries = List.filter (fun x -> Filename.check_suffix x ".xml") entries in + let entries = List.map ((//) path) entries in + let entries = List.filter is_regular_file entries in + List.iter fn entries + diff --git a/builder/osinfo.mli b/builder/osinfo.mli new file mode 100644 index 000000000..949d776a9 --- /dev/null +++ b/builder/osinfo.m...
2017 Oct 05
0
[PATCH v11 1/6] builder: add simple OCaml osinfo-db reader
...ory fn) entries + +and read_osinfo_db_flat fn path = + debug "osinfo: loading flat database from %s" path; + read_osinfo_db_directory fn path + +and read_osinfo_db_directory fn path = + let entries = Array.to_list (Sys.readdir path) in + let entries = List.filter (fun x -> Filename.check_suffix x ".xml") entries in + let entries = List.map ((//) path) entries in + let entries = List.filter is_regular_file entries in + List.iter fn entries + diff --git a/builder/osinfo.mli b/builder/osinfo.mli new file mode 100644 index 000000000..949d776a9 --- /dev/null +++ b/builder/osinfo.m...
2016 Feb 17
8
[PATCH supermin 0/2] Allow an alternate libc to be used for init.
v1 -> v2: - If we split out the init program into a separate init/ directory, that makes it much easier to build against an alternate libc. I tried to build against uClibc, but uClibc requires an entire build chain, which looked like it was going to be a massive ballache. Rich.