search for: find_map

Displaying 20 results from an estimated 32 matches for "find_map".

2023 Apr 05
2
[rhel-9.2 v2v PATCH 0/2] detect_kernels: deal with RHEL's kernel-core / kernel-modules-core split
https://bugzilla.redhat.com/show_bug.cgi?id=2175703 In RHEL-9.2, the "detect_kernels" function still exists in virt-v2v, not in the common submodule. Because we need to fix RHBZ#2175703 for RHEL-9.2.z as well, port of the identically named libguestfs-common patch series <http://mid.mail-archive.com/20230320115301.43051-1-lersek at redhat.com> to RHEL-9.2 virt-v2v. This port is
2023 Mar 20
3
[libguestfs-common PATCH 0/2] detect_kernels: deal with RHEL's kernel-core / kernel-modules-core split
https://bugzilla.redhat.com/show_bug.cgi?id=2175703 Vera Wu's testing covered a backport of this series to the virt-v2v project's rhel-9.2 branch (on top of commit 86517b17be98), where the "detect_kernels" function is still unique/internal to the virt-v2v project. The backport / cherry-pick from libguestfs-common to virt-v2v cannot be automated, but it's not difficult; only
2020 Aug 27
1
Re: [supermin PATCH] rpm: check for SQLite-based RPM DB
...oks fine, ACK. If you really wanted you could factor out > the (...).st_mtime, something like: > > (try > lstat "/var/lib/rpm/rpmdb.sqlite" > with Unix_error (ENOENT, _, _) -> > lstat "/var/lib/rpm/Packages" > ).st_mtime ACK. Sadly List.find_map is OCaml 4.10.0+ only. Should I backport it to stable-5.2? -- Pino Toscano
2016 Dec 09
0
Re: [PATCH] generator: Share Common_utils code.
...while !n > 0 && test str.[!n-1]; do > - decr n > - done; > - if !n = String.length str then str > - else String.sub str 0 !n > - > -let trim ?(test = isspace) str = > - trimr ~test (triml ~test str) Ditto. > -let (|>) x f = f x Ditto. > -let rec find_map f = function > - | [] -> raise Not_found > - | x :: xs -> > - match f x with > - | Some y -> y > - | None -> find_map f xs Ditto. Also it does not seem to be used anywhere. > -let count_chars c str = > - let count = ref 0 in > - for i = 0 to...
2019 Jan 29
2
[PATCH] v2v: linux: use NEVR for querying RPM packages (RHBZ#1669395)
...* RHEL 6 (rpm 4.8.0): + * $ rpm -q tar-2:1.23-11.el6.x86_64 + * package tar-2:1.23-11.el6.x86_64 is not installed + * Fedora 20 (rpm 4.11.2): + * $ rpm -q tar-2:1.26-30.fc20.x86_64 + * tar-1.26-30.fc20.x86_64 *) + let rpm_major, rpm_minor = + let ver = List.find_map ( + function + | { G.app2_name = name; G.app2_version = version } + when name = "rpm" -> Some version + | _ -> None + ) inspect.i_apps in + match String.nsplit "." ver with + | [major] -> int_of_string major, 0 + | maj...
2019 Jan 30
1
[PATCH v3] v2v: linux: use NEVR for querying RPM packages (RHBZ#1669395)
...$ rpm -q tar-2:1.23-11.el6.x86_64 + * package tar-2:1.23-11.el6.x86_64 is not installed + * Fedora 20 (rpm 4.11.2): + * $ rpm -q tar-2:1.26-30.fc20.x86_64 + * tar-1.26-30.fc20.x86_64 *) + let is_rpm_lt_4_11 () = + let ver = + try + let ver = List.find_map ( + function + | { G.app2_name = name; G.app2_version = version } + when name = "rpm" -> Some version + | _ -> None + ) inspect.i_apps in + if PCRE.matches re_version ver then + (int_of_string (PCRE.sub 1),...
2019 Jan 30
1
[PATCH v2] v2v: linux: use NEVR for querying RPM packages (RHBZ#1669395)
...ot; | "scientificlinux" | - "oraclelinux" | "redhat-based"; - i_major_version = v } when v < 5 -> true - | _ -> false in - if is_rhel_lt_5 then - pkg_name + let is_rpm_lt_4_11 () = + let ver = List.find_map ( + function + | { G.app2_name = name; G.app2_version = version } + when name = "rpm" -> Some version + | _ -> None + ) inspect.i_apps in + let ver = + if PCRE.matches re_version ver then + (int_of_string (PCRE.sub 1), int_of...
2012 Mar 10
6
Cartographer shows correct info box BUT over wrong marker
Hi guys (and gals), The code formatting is so nice on SO.com, so I thought I''d just share my post in hopes that someone from the group can help. http://stackoverflow.com/questions/9643786/cartographer-shows-correct-info-box-but-over-wrong-marker Feel free to answer back via email if you don''t have an SO account. Thanks! Abram -- You received this message because you are
2018 May 22
1
[PATCH v2] v2v: linux: fix kernel detection when split in different packages
...the package, falling back to the + * version in the vmlinuz file name. + *) + let modpath, version = + let prefix = "/lib/modules/" in + try + let prefix_len = String.length prefix in + List.find_map ( + fun filename -> + let filename_len = String.length filename in + if filename_len > prefix_len && + String.is_prefix filename prefix then ( + let version = String.sub filename pre...
2020 Sep 23
0
[v2v PATCH 3/3] linux: remove special handling of packages with no files
...the package, falling back to the - * version in the vmlinuz file name. - *) - let modpath, version = - let prefix = "/lib/modules/" in - try - let prefix_len = String.length prefix in - List.find_map ( - fun filename -> - let filename_len = String.length filename in - if filename_len > prefix_len && - String.is_prefix filename prefix then ( - let version = String.sub filename pre...
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...= | 1 -> false | i -> failwithf "%s: failed with error code %d" cmd i -let (|>) x f = f x - -let rec filter_map f = function - | [] -> [] - | x :: xs -> - match f x with - | Some y -> y :: filter_map f xs - | None -> filter_map f xs - -let rec find_map f = function - | [] -> raise Not_found - | x :: xs -> - match f x with - | Some y -> y - | None -> find_map f xs - -let iteri f xs = - let rec loop i = function - | [] -> () - | x :: xs -> f i x; loop (i+1) xs - in - loop 0 xs - -let mapi f xs = - let re...
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 +++
2017 Nov 21
2
[PATCH v3 0/2] common/mlstdutils: Extend the List module.
v2 -> v3: - Renamed List.assoc_ -> List.assoc_lbl. - Rebased on top of current master branch. Rich.
2019 Feb 28
2
winbind causing huge timeouts/delays since 4.8
...07386, 5, pid=18451, effective(0, 0), real(0, 0), class=passdb] ../../source3/passdb/pdb_tdb.c:600(tdbsam_getsampwnam) pdb_getsampwnam (TDB): error fetching database. Key: USER_foo [2019/02/28 10:32:52.907444, 10, pid=18451, effective(0, 0), real(0, 0)] ../../source3/groupdb/mapping_tdb.c:279(find_map) failed to unpack map [2019/02/28 10:32:52.907532, 10, pid=18451, effective(0, 0), real(0, 0)] ../../source3/groupdb/mapping_tdb.c:279(find_map) failed to unpack map [2019/02/28 10:32:52.907624, 5, pid=18451, effective(0, 0), real(0, 0)] ../../source3/lib/username.c:181(Get_Pwnam_alloc) Find...
2019 Jan 16
0
[PATCH 4/5] mltools: curl: turn Curl.run to raise exceptions
...sprintf "%s -q --config %s" (quote curl) (quote config_file) in - let lines = external_command ~echo_cmd:false cmd in + let lines, exitcode = external_command_code ~echo_cmd:false cmd in Unix.unlink config_file; + if exitcode <> 0 then ( + let url = + try + List.find_map ( + function + | "url", Some url -> Some url + | _, _ -> None + ) args + with Not_found -> s_"(unknown)" in + raise (Curl_failed (exitcode, url)) + ); lines let to_string { curl; args } = diff --git a/common/mltools/curl....
2019 Jan 30
0
Re: [PATCH] v2v: linux: use NEVR for querying RPM packages (RHBZ#1669395)
...pm -q tar-2:1.23-11.el6.x86_64 > + * package tar-2:1.23-11.el6.x86_64 is not installed > + * Fedora 20 (rpm 4.11.2): > + * $ rpm -q tar-2:1.26-30.fc20.x86_64 > + * tar-1.26-30.fc20.x86_64 > *) > + let rpm_major, rpm_minor = > + let ver = List.find_map ( > + function > + | { G.app2_name = name; G.app2_version = version } > + when name = "rpm" -> Some version > + | _ -> None > + ) inspect.i_apps in This has the nasty side effect of Not_found exception escaping if for some reason...
2020 Aug 26
2
[supermin PATCH] rpm: check for SQLite-based RPM DB
Fedora 33 switched the DB of RPM to SQLite, so no more Packages/Name/etc files. Because any missing file exception is ignored when checking for --if-newer, the lack of the Package files was not properly noticed, so the appliance was always considered out out date. Check for the SQLite-based DB first, falling back to the old format. Signed-off-by: Pino Toscano <ptoscano@redhat.com> ---
2017 Oct 08
4
[PATCH 0/3] common/mlstdutils: Add Std_utils List and Option modules.
In Std_utils we already extend Char and String. These commits take it a little further by extending List and adding a new Option submodule. All basically simple refactoring. Rich.
2017 Oct 08
7
[[PATCH v2 0/4] common/mlstdutils: Add Std_utils List and Option modules.
This time including the first commit ...
2019 Feb 26
3
winbind causing huge timeouts/delays since 4.8
Am 23.02.19 um 22:23 schrieb Rowland Penny via samba: > On Sat, 23 Feb 2019 21:54:31 +0100 > Alexander Spannagel via samba <samba at lists.samba.org> wrote: > >> Am 23.02.19 um 15:48 schrieb Rowland Penny via samba: >>>>>>>>> If you have, as you have, 'files sss winbind' in the the >>>>>>>>> passwd & group line