]> git.e2factory.org Git - e2factory.git/commitdiff
bugfix: fix error checking in files.sourceid()
authorGordon Hecker <gh@emlix.com>
Fri, 20 Nov 2009 08:47:36 +0000 (09:47 +0100)
committerGordon Hecker <gh@emlix.com>
Wed, 16 Dec 2009 11:41:58 +0000 (12:41 +0100)
Signed-off-by: Gordon Hecker <gh@emlix.com>
local/files.lua

index dd25f3516360c5ee36023a811455c497a9d5ccf9..e925046f582c0dd246adb23dea9eeaa27cabb42a 100644 (file)
@@ -309,10 +309,11 @@ end
 -- @return string: the source id, nil on error
 -- @return an error string on error
 function files.sourceid(info, sourcename, sourceset)
-       local rc, e
-       rc, e = files.validate_source(info, sourcename)
+       local rc, re
+       local e = new_error("%s: error calculating sourceid", sourcename)
+       rc, re = files.validate_source(info, sourcename)
        if not rc then
-               return false, e
+               return false, re
        end
        local src = info.sources[sourcename]
        if src.sourceid then
@@ -331,7 +332,7 @@ function files.sourceid(info, sourcename, sourceset)
                hash.hash_line(hc, licenceid)
        end
        for _,f in ipairs(src.file) do
-               local fileid = e2tool.fileid(info, f)
+               local fileid, re = e2tool.fileid(info, f)
                if not fileid then
                        return false, e:cat(re)
                end