inkscape_tools: fix Inkscape version detection on Ubuntu
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 21 Feb 2018 17:28:52 +0000 (12:28 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 21 Feb 2018 17:32:00 +0000 (12:32 -0500)
The regex detecting the Inkscape version was too permissive and expected
3 numbers. This make it wrongly match to the revision string on Ubuntu
where the version string has 2 numbers:

Inkscape 0.91 r13725

Reported-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/inkscape_tools/src/svg_to_png_and_nit.nit

index f660a31..b8a3157 100644 (file)
@@ -220,7 +220,7 @@ var p = new ProcessReader("inkscape", "--version")
 var version_string = p.read_all
 p.wait
 p.close
-var version_re = "([0-9]+\).([0-9]+\).[0-9]+".to_re
+var version_re = "([0-9]+)\\.([0-9]+)".to_re
 var match = version_string.search(version_re)
 assert match != null
 var major = match[1]