return true, nil
end
-function files.get_revision_id(info, sourcename, sourceset)
- local rc, e
- rc, e = files.validate_source(info, sourcename)
- if not rc then
- return false, e
- end
- local function files_hash_iterator(files)
- local i = nil
- local function nextfile(f)
- i = next(f, i)
- return i and files[i].hash
- end
- return nextfile, files
- end
- local s = info.sources[sourcename]
- if not s.fhash then
- -- store hash for each file
- for _,f in pairs(s.file) do
- f.hash, e = e2tool.read_hash_file(info, f.server, f.checksum_file)
- if not f.hash then
- e2lib.log(3, string.format(
- "hash file not available for %s:%s. Hashing on-the-fly",
- f.server, f.location))
- f.hash, e = e2tool.hash_file(info, f.server, f.location)
- end
- if not f.hash then
- e2lib.log(1, e)
- e2lib.abort(string.format("fetching file %s:%s", f.server, f.location))
- end
- end
- s.fhash = e2lib.compute_hash(files_hash_iterator, s.file)
- end
- return s.fhash
-end
-
--- cache files for a source
-- @param info the info structure
-- @param sourcename name of the source