]> git.e2factory.org Git - e2factory.git/commitdiff
files sources: verify hashes for source files if available
authorGordon Hecker <gh@emlix.com>
Thu, 29 Oct 2009 13:03:54 +0000 (14:03 +0100)
committerGordon Hecker <gh@emlix.com>
Thu, 29 Oct 2009 14:28:01 +0000 (15:28 +0100)
Signed-off-by: Gordon Hecker <gh@emlix.com>
local/files.lua

index e26286b0cfe804aaa0eaa7c600632ec4d6d9f1d4..d171f3f431fb1ddec4599ac88caac3f55acb6ca2 100644 (file)
@@ -224,6 +224,12 @@ function files.prepare_source(info, sourcename, sourceset, buildpath)
   e2lib.log(4, string.format("prepare source: %s", sourcename))
   local s = info.sources[sourcename]
   for _,file in ipairs(info.sources[sourcename].file) do
+    if file.sha1 then
+      rc, re = e2tool.verify_hash(info, file.server, file.location, file.sha1)
+      if not rc then
+       return false, e:cat(re)
+      end
+    end
     if file.unpack then
       local cache_flags = { cache = true }
       local rc, re = cache.cache_file(info.cache, file.server, file.location,