From: Tobias Ulmer Date: Wed, 29 Jan 2014 13:40:34 +0000 (+0100) Subject: Fix operator precedence in cvs and svn source validation X-Git-Tag: e2factory-2.3.14p0~6 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=615c2f9ba24e20b510d6e1ed0a86451d73bed356;p=e2factory.git Fix operator precedence in cvs and svn source validation "not" binds higher, turning these expressions into false == "string" on errors. src.tag not being set causes a stack trace later on. A regression test has been added. Signed-off-by: Tobias Ulmer --- diff --git a/local/cvs.lua b/local/cvs.lua index c627656..7b2599c 100644 --- a/local/cvs.lua +++ b/local/cvs.lua @@ -85,7 +85,7 @@ function cvs.validate_source(info, sourcename) if not src.branch then e:append("source has no `branch' attribute") end - if not type(src.tag) == "string" then + if type(src.tag) ~= "string" then e:append("source has no `tag' attribute or tag attribute has wrong type") end if not src.module then diff --git a/local/svn.lua b/local/svn.lua index 185c7cb..d78ac23 100644 --- a/local/svn.lua +++ b/local/svn.lua @@ -365,10 +365,10 @@ function svn.validate_source(info, sourcename) if not src.branch then e:append("source has no `branch' attribute") end - if not type(src.tag) == "string" then + if type(src.tag) ~= "string" then e:append("source has no `tag' attribute or tag attribute has wrong type") end - if not type(src.workingcopy_subdir) == "string" then + if type(src.workingcopy_subdir) ~= "string" then e2lib.warnf("WDEFAULT", "in source %s", sourcename) e2lib.warnf("WDEFAULT", " workingcopy_subdir defaults to the branch: %s", src.branch)