]> git.e2factory.org Git - e2factory.git/commitdiff
Fix operator precedence in cvs and svn source validation
authorTobias Ulmer <tu@emlix.com>
Wed, 29 Jan 2014 13:40:34 +0000 (14:40 +0100)
committerTobias Ulmer <tu@emlix.com>
Tue, 25 Mar 2014 17:07:15 +0000 (18:07 +0100)
"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 <tu@emlix.com>
local/cvs.lua
local/svn.lua

index c627656e97dc110743f9efea885255c69cef1f96..7b2599ce8c17cd61c51e31bc5bdcba3fab50594c 100644 (file)
@@ -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
index 185c7cbbc310cd9136cd8a8ff297539ccf216071..d78ac23aa272d2e90af138f62c711549d8d7be9c 100644 (file)
@@ -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)