search for: to_list

Displaying 20 results from an estimated 316 matches for "to_list".

Did you mean: io_list
2016 Aug 15
2
[PATCH v2] v2v: factor out bootloader handling
...grub/device.map/*[label() != \"#comment\"]"; + "/files/etc/sysconfig/grub/boot"; + ] + + method list_kernels () = + let paths = + let expr = sprintf "/files%s/title/kernel" grub_config in + let paths = g#aug_match expr in + let paths = Array.to_list paths in + + (* Remove duplicates. *) + let paths = remove_duplicates paths in + + (* Get the default kernel from grub if it's set. *) + let default = + let expr = sprintf "/files%s/default" grub_config in + try + let idx = g#aug_get expr in...
2015 Nov 20
0
[PATCH] v2v: factor out bootloader handling
...grub/device.map/*[label() != \"#comment\"]"; + "/files/etc/sysconfig/grub/boot"; + ] + + method list_kernels () = + let paths = + let expr = sprintf "/files%s/title/kernel" grub_config in + let paths = g#aug_match expr in + let paths = Array.to_list paths in + + (* Remove duplicates. *) + let paths = remove_duplicates paths in + + (* Get the default kernel from grub if it's set. *) + let default = + let expr = sprintf "/files%s/default" grub_config in + try + let idx = g#aug_get expr in...
2016 Aug 15
0
Re: [PATCH v2] v2v: factor out bootloader handling
...ment\"]"; > + "/files/etc/sysconfig/grub/boot"; > + ] > + > + method list_kernels () = > + let paths = > + let expr = sprintf "/files%s/title/kernel" grub_config in > + let paths = g#aug_match expr in > + let paths = Array.to_list paths in > + > + (* Remove duplicates. *) > + let paths = remove_duplicates paths in > + > + (* Get the default kernel from grub if it's set. *) > + let default = > + let expr = sprintf "/files%s/default" grub_config in > + try...
2016 Aug 09
2
Re: [PATCH 2/8] v2v: add basic support for the "deb" package manager
....guestfs) inspect app = > let package_format = inspect.i_package_format in > > match package_format with > + | "deb" -> > + let cmd = [| "dpkg"; "-L"; app.G.app2_name |] in > + debug "%s" (String.concat " " (Array.to_list cmd)); > + let files = g#command_lines cmd in > + let files = Array.to_list files in > + List.sort compare files > | "rpm" -> > (* Since RPM allows multiple packages installed with the same > * name, always check the full ENVR here (RHBZ#1161250...
2016 Aug 25
2
[PATCH v2] v2v: factor out bootloader handling
...ot; in - Str.replace_first rex "\\1" - in - - let vmlinuzes = - match grub with - | `Grub1 -> - let paths = - let expr = sprintf "/files%s/title/kernel" grub_config in - let paths = g#aug_match expr in - let paths = Array.to_list paths in - - (* Remove duplicates. *) - let paths = remove_duplicates paths in - - (* Get the default kernel from grub if it's set. *) - let default = - let expr = sprintf "/files%s/default" grub_config in - try -...
2016 Aug 10
1
[PATCH 2/7] v2v: add basic support for the "deb" package manager
...e_list_of_package (g : Guestfs.guestfs) inspect app = let package_format = inspect.i_package_format in match package_format with + | "deb" -> + let cmd = [| "dpkg"; "-L"; app.G.app2_name |] in + debug "%s" (String.concat " " (Array.to_list cmd)); + let files = g#command_lines cmd in + let files = Array.to_list files in + List.sort compare files | "rpm" -> (* Since RPM allows multiple packages installed with the same * name, always check the full ENVR here (RHBZ#1161250). @@ -98,6 +108,29 @@ let fil...
2016 Aug 09
1
Re: [PATCH 2/8] v2v: add basic support for the "deb" package manager
...= inspect.i_package_format in > > > > > > match package_format with > > > + | "deb" -> > > > + let cmd = [| "dpkg"; "-L"; app.G.app2_name |] in > > > + debug "%s" (String.concat " " (Array.to_list cmd)); > > > + let files = g#command_lines cmd in > > > + let files = Array.to_list files in > > > + List.sort compare files > > > | "rpm" -> > > > (* Since RPM allows multiple packages installed with the same > > >...
2012 Apr 18
1
[PATCH RFC] sysprep: remove user accounts
...Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) + +open Sysprep_operation + +module G = Guestfs + +let user_account_perform g root = + let typ = g#inspect_get_type root in + if typ <> "windows" then ( + let login_def = "/etc/login.defs" in + let lines = Array.to_list (g#read_lines login_def) in + let line_min = Array.filter ( + fun line -> (string_prefix line "UID_MIN") + ) lines in + let _,min_uid = sscanf line_min "%s %d" (fun a b -> a,b) in + let line_max = Array.filter ( + fun line -> (string_prefix line &q...
2016 Aug 08
11
[PATCH 0/8] v2v: first bits of Debian/Ubuntu guests supports
Hi, this series implements the first bits in v2v to convert Debian/Ubuntu (and derived) guests. The series does not complete the support (see known issues below), but all the patches here should be fit for review and inclusion. The series does not enable the conversion, yet. Known issues: * there is no grubby nor Bootloader::Tools Perl module available in Debian, so there is no way to know
2014 Feb 13
2
Re: [PATCH] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).
On Thursday 13 February 2014 13:33:16 Richard W.M. Jones wrote: > On Thu, Feb 13, 2014 at 02:15:31PM +0100, Pino Toscano wrote: > > + let expr = "/files/etc/hosts/*[label() != '#comment']/*[label() > > != 'ipaddr'][. = '" ^ oldhost ^ "']" in > Quoting? If oldhost contains a ' character + some Augeas code, this > might be
2020 Sep 23
3
[v2v PATCH 1/3] linux: remove warning for packages with no files
Metapackages are valid packages with no files, used to easily install something without manually installing bits. This is the case of the "kernel" package in Fedora/RHEL/etc in the last couple of years. --- v2v/linux_kernels.ml | 1 - 1 file changed, 1 deletion(-) diff --git a/v2v/linux_kernels.ml b/v2v/linux_kernels.ml index 9a41225a..78c1ee59 100644 --- a/v2v/linux_kernels.ml +++
2016 Aug 09
0
Re: [PATCH 2/8] v2v: add basic support for the "deb" package manager
...gt; let package_format = inspect.i_package_format in > > > > match package_format with > > + | "deb" -> > > + let cmd = [| "dpkg"; "-L"; app.G.app2_name |] in > > + debug "%s" (String.concat " " (Array.to_list cmd)); > > + let files = g#command_lines cmd in > > + let files = Array.to_list files in > > + List.sort compare files > > | "rpm" -> > > (* Since RPM allows multiple packages installed with the same > > * name, always check th...
2014 Sep 22
1
Re: [PATCH v3 3/7] resize: add function find_partitions
...> --- a/resize/resize.ml > +++ b/resize/resize.ml > @@ -446,14 +446,15 @@ read the man page virt-resize(1). > | MBR_ID _ | GPT_Type _ | No_ID -> false > in > > - let partitions : partition list = > + let find_partitions part_type = > let parts = Array.to_list (g#part_list "/dev/sda") in > > - if List.length parts = 0 then > - error (f_"the source disk has no partitions"); > - > (* Filter out logical partitions. See note above. *) > let parts = > + match part_type with > + (* for...
2017 Sep 22
0
[PATCH v3 13/22] v2v: linux: Properly ignore rpm/dpkg-move-aside kernels.
...--- v2v/linux_bootloaders.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2v/linux_bootloaders.ml b/v2v/linux_bootloaders.ml index 210cce762..00cb5cd19 100644 --- a/v2v/linux_bootloaders.ml +++ b/v2v/linux_bootloaders.ml @@ -319,9 +319,9 @@ object (self) Array.to_list (g#glob_expand "/boot/kernel-*") @ Array.to_list (g#glob_expand "/boot/vmlinuz-*") @ Array.to_list (g#glob_expand "/vmlinuz-*") in - let rex = Str.regexp ".*\\.\\(dpkg-.*|rpmsave|rpmnew\\)$" in + let rex = PCRE.compile "\\.(?:dpkg...
2016 Aug 08
0
[PATCH 2/8] v2v: add basic support for the "deb" package manager
...e_list_of_package (g : Guestfs.guestfs) inspect app = let package_format = inspect.i_package_format in match package_format with + | "deb" -> + let cmd = [| "dpkg"; "-L"; app.G.app2_name |] in + debug "%s" (String.concat " " (Array.to_list cmd)); + let files = g#command_lines cmd in + let files = Array.to_list files in + List.sort compare files | "rpm" -> (* Since RPM allows multiple packages installed with the same * name, always check the full ENVR here (RHBZ#1161250). @@ -98,6 +108,19 @@ let fil...
2017 Oct 19
1
[PATCH] v2v: Fix RPM file owned test (RHBZ#1503958).
...ith multiarch the same - * package is allowed (although with different architectures). - * This function returns only one package in all the cases. - *) - let cmd = [| "dpkg"; "-S"; path |] in - debug "%s" (String.concat " " (Array.to_list cmd)); - let lines = - try g#command_lines cmd - with Guestfs.Error msg as exn -> - if String.find msg "no path found matching pattern" >= 0 then - raise Not_found - else - raise exn in - if Array.length lines = 0 then...
2017 Jan 03
0
[PATCH 1/5] builder: extract Yajl helper functions to yajl.ml
...8,58 +28,6 @@ let ensure_trailing_slash str = if String.length str > 0 && str.[String.length str - 1] <> '/' then str ^ "/" else str -let object_find_optional key = function - | Yajl_object o -> - (match List.filter (fun (k, _) -> k = key) (Array.to_list o) with - | [(k, v)] -> Some v - | [] -> None - | _ -> error (f_"more than value for the key '%s'") key) - | _ -> error (f_"the value of the key '%s' is not an object") key - -let object_find key yv = - match object_find_optional key yv wit...
2016 Oct 04
1
[PATCH] v2v: linux: try to fix removal of VMware tools
...* package can depend on something provided. *) - let cmd = ["yum"; "-q"; "resolvedep"] @ provides in - let cmd = Array.of_list cmd in - let replacements = g#command_lines cmd in - let replacements = Array.to_list replacements in - - let cmd = [ "yum"; "install"; "-y" ] @ replacements in - let cmd = Array.of_list cmd in - (try - ignore (g#command cmd); - push_front library remove - with G.Error msg -> -...
2016 Aug 01
3
[PATCH] v2v: fixed file_owner function
...one package. *) - let cmd = [| "rpm"; "-qf"; "--qf"; "%{NAME}"; path |] in + let cmd = [| "rpm"; "-qf"; "--qf"; "%{NAME}\\n"; path |] in debug "%s" (String.concat " " (Array.to_list cmd)); - (try g#command cmd + (try + let pkgs = g#command_lines cmd in + pkgs.(0) with Guestfs.Error msg as exn -> if String.find msg "is not owned" >= 0 then raise Not_found else raise exn + | Inval...
2017 Jan 03
0
[PATCH 4/5] mllib: add libosinfo DB reading helpers
...opy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) +open Common_utils +open Osinfopath + +let osinfo_db_read_three_levels os_path filter = + let distros = Array.to_list (Sys.readdir os_path) in + remove_duplicates ( + List.concat ( + List.map ( + fun distro -> + let distro_path = os_path // distro in + let os_files = Array.to_list (Sys.readdir distro_path) in + List.map ( + fun os_file -> + l...