Re: [PATCHv2 2/4] Add virt_viewer_compare_version()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 08, 2013 at 03:15:35PM +0100, Marc-André Lureau wrote:
> ---
>  src/virt-viewer-util.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>  src/virt-viewer-util.h |  1 +
>  2 files changed, 50 insertions(+)
> 
> diff --git a/src/virt-viewer-util.c b/src/virt-viewer-util.c
> index f0b1182..344bd13 100644
> --- a/src/virt-viewer-util.c
> +++ b/src/virt-viewer-util.c
> @@ -414,6 +414,55 @@ spice_hotkey_to_gtk_accelerator(const gchar *key)
>      return accel;
>  }
>  
> +/**
> + * virt_viewer_compare_version:
> + * @s1: a version-like string
> + * @s2: a version-like string
> + *
> + * Compare two version-like strings: 1.1 > 1.0, 1.0.1 > 1.0, 1.10 > 1.7...
> + *
> + * String suffix (1.0rc1 etc) are not accepted, and will return 0.

While I agree with Hans that we don't want to try to handle rc1, a, ...
there, this code will also choke on versions like 0.18.13-09abc (which
spice-gtk uses for git snapshots), this might be needed at some point

Christophe

Attachment: pgp0ohxubHCVS.pgp
Description: PGP signature

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux