search for: compare_version

Displaying 20 results from an estimated 49 matches for "compare_version".

2017 Aug 03
14
[PATCH supermin 0/9] kernel: Multiple fixes to handling of kernels (RHBZ#1477758).
This patch series fixes several problems in the way that supermin handles kernels. The most pressing problem is that supermin doesn't handle bogus vmlinuz files which aren't actual kernels. Along the way there is a lot of clean up. The patches look much better if you view them with ‘-w’. This series will require plenty of time to be tested in Fedora, especially on non-x86 arches.
2015 Aug 12
2
Re: [PATCH 1/2] builder: add non-int revisions
On Wed, Aug 12, 2015 at 03:12:21PM +0200, Pino Toscano wrote: > Add support for non-integer revisions of entries, comparing them as > integer when possible. Have you got an example of revisions? It may be possible to use Common_utils.compare_version which does RPM revision-style comparison. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual ma...
2016 Nov 21
2
[PATCH 1/2] kernel: refactor build_kernel & find_kernel
...vr /boot/vmlinuz-* 2>/dev/null | grep -v xen *) - kernel_filter ["vmlinu?-*"] is_arm all_files in + copy_or_symlink_file copy_kernel kernel_file kernel; - if files = [] then no_kernels host_cpu; + (kernel_version, modpath) - let files = List.sort (fun a b -> compare_version b a) files in - let kernel_name = List.hd files in - let kernel_version = get_kernel_version kernel_name in +and find_kernel debug host_cpu kernel = + let is_arm = + String.length host_cpu >= 3 && + host_cpu.[0] = 'a' && host_cpu.[1] = 'r' &&a...
2014 Apr 26
2
[supermin] Be smarter about finding suitable kernel images
...dev/null | grep -v xen *) - kernel_filter "vmlinuz-*" is_arm all_files in + kernel_filter ["vmlinu?-*"] is_arm all_files in - if files = [] then no_kernels (); + if files = [] then no_kernels (host_cpu); let files = List.sort (fun a b -> compare_version b a) files in let kernel_name = List.hd files in @@ -95,10 +103,13 @@ and find_kernel debug host_cpu copy_kernel kernel = copy_or_symlink_file copy_kernel kernel_file kernel; kernel_name, kernel_version -and kernel_filter patt is_arm all_files = +and kernel_filter patterns is_arm all...
2015 Jan 28
4
[PATCH 0/3] sparsify: Ignore read-only LVs (RHBZ#1185561).
virt-sparsify shouldn't die if sparsifying a filesystem that contains read-only LVs. https://bugzilla.redhat.com/show_bug.cgi?id=1185561 I thought about trying to make the LV writable temporarily, but I suspect that if the sysadmin has made the LV read-only, then they probably did it for a reason, so we shouldn't touch it. Rich.
2014 Apr 28
2
Re: [supermin] Be smarter about finding suitable kernel images
* Richard W.M. Jones: > On Sat, Apr 26, 2014 at 02:27:07PM +0200, Hilko Bengen wrote: >> --- >> src/kernel.ml | 43 ++++++++++++++++++++++++++++--------------- >> 1 file changed, 28 insertions(+), 15 deletions(-) >> >> diff --git a/src/kernel.ml b/src/kernel.ml >> index ed5aea3..436b1b0 100644 >> --- a/src/kernel.ml >> +++ b/src/kernel.ml
2014 Nov 24
5
[PATCH] rpm: use librpm's rpmvercmp
...string -> int type t diff --git a/src/rpm.ml b/src/rpm.ml index 640a02a..ce803e1 100644 --- a/src/rpm.ml +++ b/src/rpm.ml @@ -144,7 +144,7 @@ let rpm_package_of_string str = * architecture. *) let cmp { version = v1; arch = a1 } { version = v2; arch = a2 } = - let i = compare_version v2 v1 in + let i = rpm_vercmp v2 v1 in if i <> 0 then i else compare_architecture a2 a1 in -- 1.9.3
2015 Aug 12
0
Re: [PATCH 1/2] builder: add non-int revisions
...to trivially order versions to find the most recent. Ubuntu uses "serial" numbers for these keys, in the format YYYYMMDD[.0-9]. json files for Ubuntu and CirrOS images uses this format, although it seems to not be a strict rule. > It may be possible to use > Common_utils.compare_version which does RPM revision-style comparison. Hm so you are suggesting to just make the revision internally as string (but still forcing an integer in native indexes)? That would work too, I guess. Thanks, -- Pino Toscano
2016 May 23
0
[PATCH 4/5] mllib: move stringify_args from dib
...ternal command, slurp up the output as a list of lines. *) let external_command ?(echo_cmd = true) cmd = if echo_cmd then diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 7f288b4..5bcc692 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -239,6 +239,10 @@ val compare_version : string -> string -> int val compare_lvm2_uuids : string -> string -> int (** Compare two LVM2 UUIDs, ignoring '-' characters. *) +val stringify_args : string array -> string +(** Create a "pretty-print" representation of a program invocation + (i.e. executa...
2016 Nov 21
0
[PATCH 2/2] kernel: find vmlinuz kernels in modules path (RHBZ#1394699)
..._list files in + let kernels = + List.map ( + fun f -> + let modpath = Filename.dirname f in + f, Filename.basename f, Filename.basename modpath, modpath + ) files in + List.sort ( + fun (_, _, a, _) (_, _, b, _) -> compare_version b a + ) kernels in + + if kernels <> [] then ( + let kernel = List.hd kernels in + if debug >= 1 then ( + let kernel_file, _, _, _ = kernel in + printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; + ); + kernel +...
2017 Aug 03
0
[PATCH supermin 9/9] kernel: Reject implausibly small kernels in /lib/modules (RHBZ#1477758).
...e kernel_file in + let modpath = Filename.dirname kernel_file in + let kernel_version = Filename.basename modpath in + Some (kernel_file, kernel_name, kernel_version, modpath) + ) ) files in List.sort ( fun (_, _, a, _) (_, _, b, _) -> compare_version b a -- 2.13.1
2019 Apr 12
0
[supermin PATCH 5/5] utils: remove unused 'compare_architecture' function
...se_size = let const_re = Str.regexp "^\\([.0-9]+\\)\\([bKMG]\\)$" in diff --git a/src/utils.mli b/src/utils.mli index 7837dbb..b86586a 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -86,9 +86,6 @@ val filter_map : ('a -> 'b option) -> 'a list -> 'b list val compare_version : string -> string -> int (** Compare two version-like strings. *) -val compare_architecture : string -> string -> int - (** Compare two architecture strings. *) - val parse_size : string -> int64 (** Parse a size field, eg. [10G] *) -- 2.20.1
2015 Jun 11
2
[PATCH] (Almost) new tool: virt-get-kernel
...rds <> [] then initrds else glob "/boot/initrd-*" in - - (* Debian/Ubuntu: *) - let initrds = if initrds <> [] then initrds else glob "/boot/initrd.img-*" in - - (* Sort by version to get the latest version as first element. *) - let kernels = List.rev (List.sort compare_version kernels) in - let initrds = List.rev (List.sort compare_version initrds) in - - if kernels = [] then - error (f_"no kernel found"); - - (* Download the latest. *) - let outputdir = - match output with - | None -> Filename.current_dir_name - | Some dir -> dir in - le...
2016 Sep 09
2
[PATCH] v2v: utils: Replace "remove_duplicates" function with call to sort_uniq.
...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 = compare_version app1.Guestfs.app2_release app2.Guestfs.app2_release ) -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 -...
2015 Mar 18
0
[PATCH 1/2] mllib: allow external_command to return on nonzero return value
...%s' stopped by signal %d") cmd i - ); - lines (* Run uuidgen to return a random UUID. *) let uuidgen ~prog () = diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 28ba648..ce2242a 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -109,7 +109,7 @@ val compare_version : string -> string -> int val compare_lvm2_uuids : string -> string -> int (** Compare two LVM2 UUIDs, ignoring '-' characters. *) -val external_command : prog:string -> string -> string list +val external_command : prog:string -> ?ignore_error:bool -> string -&g...
2015 Oct 29
7
[PATCH 0/7] v2v: Miscellaneous refactorings.
Just refactoring. Rich.
2016 Sep 23
2
[PATCH 1/2] mllib: move remove_duplicates from v2v
...-> 'a -> unit val push_front : 'a -> 'a list ref -> unit val pop_back : 'a list ref -> 'a diff --git a/v2v/utils.ml b/v2v/utils.ml index d1ddee7..fb0b802 100644 --- a/v2v/utils.ml +++ b/v2v/utils.ml @@ -81,15 +81,6 @@ let compare_app2_versions app1 app2 = compare_version app1.Guestfs.app2_release app2.Guestfs.app2_release ) -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 -...
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
...d libguestfs command line options to the specified ones, sorting them, and setting [long_options] to them. + [key_opts] specifies whether add the standard options related to + keys management, i.e. [--echo-keys] and [--keys-from-stdin]. + Returns a new [Getopt.t] handle. *) val compare_version : string -> string -> int @@ -390,3 +393,8 @@ val which : string -> string (** Return the full path of the specified executable from [$PATH]. Throw [Executable_not_found] if not available. *) + +val inspect_decrypt : Guestfs.guestfs -> unit +(** Simple implementation of decrypti...
2016 Dec 08
3
[PATCH 1/2] Remove most instances of OCaml warning 52.
...quot;%s: expecting an int64, but got '%s'" test_name arg in pr ", %Ld" i | Bool _, arg, _ -> diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index f4ddf01..f948dce 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -730,7 +730,7 @@ let compare_version v1 v2 = let rest = Str.matched_group 2 str in let n = try `Number (int_of_string n) - with Failure "int_of_string" -> `String n in + with Failure _ -> `String n in n, rest ) else if Str.string_matc...
2007 Apr 14
0
[965] branches/wxruby2/wxwidgets_282/doc/textile: Misc.
...t;span class="cx"> h3(#XmlResource_clearhandlers). XmlResource#clear_handlers </span><span class="lines">@@ -112,7 +112,7 @@ </span><span class="cx"> </span><span class="cx"> h3(#XmlResource_compareversion). XmlResource#compare_version </span><span class="cx"> </span><del>- Integer *compare_version*(%(arg-type)Integer% major, %(arg-type)Integer% minor, </del><ins>+ Integer *compare_version*(%(arg-type)Integer% major, %(arg-type)Integer% minor, </ins><span class="cx&q...