From ae5b41ef19ac9cc806b749821c0881aac177f3c6 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Fri, 8 Mar 2024 13:35:39 -0500 Subject: Removed files that fail checks. --- src/lpm.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lpm.lua b/src/lpm.lua index 8e972ae..c611d51 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -581,7 +581,10 @@ function common.get(source, options) if not system.stat(cache_path) then res, headers = system.get(protocol, hostname, port, rest, cache_path .. ".part", callback) if headers.location then return common.get(headers.location, common.merge(options, { depth = (depth or 0) + 1 })) end - if checksum ~= "SKIP" and system.hash(cache_path .. ".part", "file") ~= checksum then fatal_warning("checksum doesn't match for " .. source) end + if checksum ~= "SKIP" and system.hash(cache_path .. ".part", "file") ~= checksum then + common.rmrf(cache_path .. ".part") + fatal_warning("checksum doesn't match for " .. source) + end common.rename(cache_path .. ".part", cache_path) end if target then common.copy(cache_path, target) else res = io.open(cache_path, "rb"):read("*all") end -- cgit v1.2.3