Quoting Emil Velikov (2018-08-16 09:18:57)
> From: Emil Velikov <[email protected]>
> 
> Handling the version comparison by hand is a bad idea. Python has a handy
> module distutils for that - use it.
> 
> Cc: Dylan Baker <[email protected]>
> Signed-off-by: Emil Velikov <[email protected]>
> ---
> Not entirely sure if Loose or Strict version should be used. Input
> highly appreciated.

I believe python uses sym-version for releases, which is what StrictVersion is
for. I'm not sure how they tag pre-release versions (or if we really care about
pre-release versions). You should be fine with LooseVersion,

Reviewed-by: Dylan Baker <[email protected]>

> ---
>  m4/ax_check_python_mako_module.m4 | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/m4/ax_check_python_mako_module.m4 
> b/m4/ax_check_python_mako_module.m4
> index 7d9bb511c09..1d293d821c3 100644
> --- a/m4/ax_check_python_mako_module.m4
> +++ b/m4/ax_check_python_mako_module.m4
> @@ -45,11 +45,12 @@ AC_DEFUN([AX_CHECK_PYTHON_MAKO_MODULE],
>  try:
>      import sys
>      import mako
> +    import distutils.version
>  except ImportError as err:
>      sys.exit(err)
>  else:
> -    ver_req = map(int, '$1'.split('.'))
> -    ver_act = map(int, mako.__version__.split('.'))
> +    ver_req = distutils.version.LooseVersion('$1')
> +    ver_act = distutils.version.LooseVersion(mako.__version__)
>      sys.exit(int(ver_req > ver_act))
>      " | $PYTHON2 -
>  
> -- 
> 2.18.0
> 

Attachment: signature.asc
Description: signature

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to