From 65de8a7ab5bac633b28a4deb4e2ccc1a6817aafb Mon Sep 17 00:00:00 2001 From: Arvydas Sidorenko Date: Fri, 22 Jun 2012 01:22:01 +0200 Subject: [PATCH] Broken lgi version checking Currently it takes `require('lgi.version')`, converts it blindly to number and compares with another value. I am using lgi v0.6.1 and that is not convertable to number value, thus tonumber() returns nil and crashes Awesome. The fix is to take major and minor numbers only ignoring the rest. Signed-off-by: Arvydas Sidorenko Signed-off-by: Uli Schlachter --- lib/gears/surface.lua.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gears/surface.lua.in b/lib/gears/surface.lua.in index 774f2836..eced69e9 100644 --- a/lib/gears/surface.lua.in +++ b/lib/gears/surface.lua.in @@ -9,7 +9,7 @@ local type = type local capi = { awesome = awesome } local cairo = require("lgi").cairo -if tonumber(require("lgi.version")) <= 0.5 then +if tonumber(string.match(require('lgi.version'), '(%d%.%d)')) <= 0.5 then error("lgi too old, need at least version 0.7 (not yet released?) or recent git") end