search for: remove_duplicates

Displaying 20 results from an estimated 57 matches for "remove_duplicates".

2016 Sep 23
2
[PATCH 1/2] mllib: move remove_duplicates from v2v
...s changed, 15 insertions(+), 12 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 81d8202..78618f5 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -297,6 +297,15 @@ let sort_uniq ?(cmp = Pervasives.compare) xs = let xs = uniq ~cmp xs in xs +let remove_duplicates xs = + let h = Hashtbl.create (List.length xs) in + let rec loop = function + | [] -> [] + | x :: xs when Hashtbl.mem h x -> xs + | x :: xs -> Hashtbl.add h x true; x :: loop xs + in + loop xs + let push_back xsp x = xsp := !xsp @ [x] let push_front x xsp = xsp := x :: !xsp...
2016 Sep 09
2
[PATCH] v2v: utils: Replace "remove_duplicates" function with call to sort_uniq.
...n(+), 13 deletions(-) diff --git a/v2v/linux_bootloaders.ml b/v2v/linux_bootloaders.ml index a5e4c8d..7c48480 100644 --- a/v2v/linux_bootloaders.ml +++ b/v2v/linux_bootloaders.ml @@ -76,7 +76,7 @@ object let paths = Array.to_list paths in (* Remove duplicates. *) - let paths = remove_duplicates paths in + let paths = sort_uniq paths in (* Get the default kernel from grub if it's set. *) let default = diff --git a/v2v/utils.ml b/v2v/utils.ml index ec69abb..6e68583 100644 --- a/v2v/utils.ml +++ b/v2v/utils.ml @@ -79,15 +79,6 @@ let compare_app2_versions app1 app2 =...
2016 Sep 23
0
[PATCH 2/2] dib: use remove_duplicates instead of own code
...dline.ml b/dib/cmdline.ml index 1fd6c71..144e5a7 100644 --- a/dib/cmdline.ml +++ b/dib/cmdline.ml @@ -107,7 +107,7 @@ read the man page virt-dib(1). let formats = ref ["qcow2"] in let set_format arg = - let fmts = remove_dups (String.nsplit "," arg) in + let fmts = remove_duplicates (String.nsplit "," arg) in List.iter ( function | "qcow2" | "tar" | "raw" | "vhd" | "docker" -> () diff --git a/dib/utils.ml b/dib/utils.ml index a2046cb..3df5171 100644 --- a/dib/utils.ml +++ b/dib/utils.ml @@ -91,10...
2016 Sep 09
0
Re: [PATCH] v2v: utils: Replace "remove_duplicates" function with call to sort_uniq.
On Friday, 9 September 2016 15:33:20 CEST Richard W.M. Jones wrote: > --- > v2v/linux_bootloaders.ml | 2 +- > v2v/utils.ml | 9 --------- > v2v/utils.mli | 3 --- > 3 files changed, 1 insertion(+), 13 deletions(-) Hm this may change the order of the grub1 kernels though. Also the sorting done with a simple string comparison function will not always produce
2016 Aug 26
2
[Progress Update] LLVM Runtimes Subdirectory
...olin/devel/llvm/workdir/libs/build/runtimes/builtins-bins ninja: no work to do. [677/681] No install step for 'builtins' [680/681] Performing configure step for 'runtimes' -- Compiler-RT supported architectures: x86_64;i386 CMake Error at CMakeLists.txt:93 (list): list sub-command REMOVE_DUPLICATES requires list to be present. CMake logs attached. --renato -------------- next part -------------- A non-text attachment was scrubbed... Name: CMakeLogs.zip Type: application/zip Size: 3496 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160826/85893be8/a...
2017 Jan 03
0
[PATCH 4/5] mllib: add libosinfo DB reading helpers
...e 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 -> + let file_path = distro_path // os_file in +...
2015 Aug 12
0
[PATCH 1/2] builder: add non-int revisions
...| 4 ++-- builder/utils.ml | 7 +++++++ 8 files changed, 25 insertions(+), 11 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index adfa412..260af94 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -34,6 +34,13 @@ open Printf let () = Random.self_init () let remove_duplicates index = + let compare_revisions rev1 rev2 = + match rev1, rev2 with + | Rev_int n1, Rev_int n2 -> compare n1 n2 + | Rev_string s1, Rev_int n2 -> compare s1 (string_of_int n2) + | Rev_int n1, Rev_string s2 -> compare (string_of_int n1) s2 + | Rev_string s1, Rev_string s2 -&g...
2019 Jan 16
0
[PATCH 5/5] builder: ignore repositories with download failures
...in + Some parsed_index + with + | Curl.Curl_failed (code, url) -> + warning (f_"failed to download ‘%s’ (code %d), ignoring repository ‘%s’") + url code source.Sources.name; + None ) sources ) in let index = remove_duplicates index in -- 2.20.1
2015 Jul 28
0
[PATCH 01/10] builder: add format=FMT in repository .conf files
...~gpgkey:source.Sources.gpgkey in - Index_parser.get_index ~downloader ~sigchecker source + match source.Sources.format with + | Sources.FormatNative -> + Index_parser.get_index ~downloader ~sigchecker source ) sources ) in let index = remove_duplicates index in diff --git a/builder/sources.ml b/builder/sources.ml index b774762..b21e8fc 100644 --- a/builder/sources.ml +++ b/builder/sources.ml @@ -27,7 +27,10 @@ type source = { uri : string; gpgkey : Utils.gpgkey_type; proxy : Downloader.proxy_mode; + format : source_format; } +and sourc...
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.
2015 Jul 28
0
[PATCH 06/10] builder: split Index_parser.index in an own module
...\ @@ -54,6 +55,7 @@ SOURCES_ML = \ pxzcat.ml \ setlocale.ml \ checksums.ml \ + index.ml \ ini_reader.ml \ paths.ml \ languages.ml \ diff --git a/builder/builder.ml b/builder/builder.ml index 6f2b4bd..a30dbd1 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -40,7 +40,7 @@ let remove_duplicates index = *) let nseen = Hashtbl.create 13 in List.iter ( - fun (name, { Index_parser.arch = arch; revision = revision }) -> + fun (name, { Index.arch = arch; revision = revision }) -> let id = name, arch in try let rev = Hashtbl.find nseen id in @@ -50,7...
2015 Aug 12
4
[PATCH 0/2 v2] RFC: builder: support for Simple Streams metadata
Hi, this series adds a basic support for Simple Streams v1.0 metadata files. This makes it possible to create a repository .conf files with [cirros] uri=http://download.cirros-cloud.net format=simplestreams to read the latest version of each CirrOS image. TODO items: - check the pasted metadata: listing and creating images works, so most of the current metadata is correct - possibly wait
2016 Jan 14
2
[PATCH 1/2] builder: move os-version search in own function
...aviour changes. --- builder/builder.ml | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index 9c26573..ec9919f 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -75,6 +75,30 @@ let remove_duplicates index = false ) index +(* Look for the specified os-version, resolving it as alias first. *) +let selected_cli_item cmdline index = + let arg = + (* Try to resolve the alias. *) + try + let item = + List.find ( + fun (name, { Index.aliases = aliases }) -&gt...
2014 Oct 31
0
[PATCH] builder: pass Sources.source objects directly
...rser.get_index ~prog ~verbose ~downloader ~sigchecker ~proxy source + Sigchecker.create ~verbose ~gpg ~check_signature + ~gpgkey:source.Sources.gpgkey in + Index_parser.get_index ~prog ~verbose ~downloader ~sigchecker source ) sources ) in let index = remove_duplicates index in diff --git a/builder/index_parser.ml b/builder/index_parser.ml index 00b0e49..e2d48d7 100644 --- a/builder/index_parser.ml +++ b/builder/index_parser.ml @@ -111,14 +111,14 @@ let print_entry chan (name, { printable_name = printable_name; ); if hidden then fp "hidden=true\n"...
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.
2020 Mar 26
12
Upgrading LLVM's minimum required CMake version
.....>, $<CXX_COMPILER_ID:...>, $<COMPILE_LANGUAGE:...>, and $<PLATFORM_ID:...> generator expressions support matching one value from a list * $<COMPILE_LANG_AND_ID:...> generator expression added * $<FILTER:list,INCLUDE|EXCLUDE,regex> generator expression added * $<REMOVE_DUPLICATES:list> generator expression added * New $<TARGET_FILE*> generator expressions added: $<TARGET_FILE_PREFIX:...>, $<TARGET_FILE_BASE_NAME:...>, $<TARGET_FILE_SUFFIX:...>, $<TARGET_LINKER_FILE_PREFIX:...>, $<TARGET_LINKER_FILE_BASE_NAME:...>, $<TARGET_LINKER_FI...
2017 Oct 08
7
[[PATCH v2 0/4] common/mlstdutils: Add Std_utils List and Option modules.
This time including the first commit ...
2020 Mar 26
4
Upgrading LLVM's minimum required CMake version
...D:...>, $<COMPILE_LANGUAGE:...>, and $<PLATFORM_ID:...> generator expressions support matching one value from a list >> * $<COMPILE_LANG_AND_ID:...> generator expression added >> * $<FILTER:list,INCLUDE|EXCLUDE,regex> generator expression added >> * $<REMOVE_DUPLICATES:list> generator expression added >> * New $<TARGET_FILE*> generator expressions added: $<TARGET_FILE_PREFIX:...>, $<TARGET_FILE_BASE_NAME:...>, $<TARGET_FILE_SUFFIX:...>, $<TARGET_LINKER_FILE_PREFIX:...>, $<TARGET_LINKER_FILE_BASE_NAME:...>, $<TARGET_...
2016 Aug 15
2
[PATCH v2] v2v: factor out bootloader handling
...;/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 + let idx = int_of_string idx in + (* Grub indices are zero-ba...
2016 Aug 26
3
[Progress Update] LLVM Runtimes Subdirectory
Hi LLVM-Dev, Over the past week or so I’ve been working on build system improvements around the LLVM runtimes directory. You may remember this from the LLVM-Dev discussion (http://lists.llvm.org/pipermail/llvm-dev/2016-June/100859.html), or the patch review discussion (https://reviews.llvm.org/D20992) back in June. Recently, I’ve made a handful of new changes that actually make it useful, and I