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

Re: [virt-tools-list] [PATCHv2 2/4] Add virt_viewer_compare_version()



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: pgpa8O2QvuIZU.pgp
Description: PGP signature


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