diff options
| -rw-r--r-- | xmake/actions/require/impl/action/patch_sources.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/devel/git/apply.lua | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/xmake/actions/require/impl/action/patch_sources.lua b/xmake/actions/require/impl/action/patch_sources.lua index f1be7eb60..eff4df42b 100644 --- a/xmake/actions/require/impl/action/patch_sources.lua +++ b/xmake/actions/require/impl/action/patch_sources.lua @@ -36,7 +36,9 @@ function _check_sha256(patch_hash, patch_file) -- local tmpfile = os.tmpfile(patch_file) os.cp(patch_file, tmpfile) - io.gsub(tmpfile, '\r\n', '\n') + local content = io.readfile(tmpfile, {encoding = "binary"}) + content = content:gsub('\r\n', '\n') + io.writefile(tmpfile, content, {encoding = "binary"}) ok = (patch_hash == hash.sha256(tmpfile)) os.rm(tmpfile) end diff --git a/xmake/modules/devel/git/apply.lua b/xmake/modules/devel/git/apply.lua index 46d3f8ca6..7ed356f5e 100644 --- a/xmake/modules/devel/git/apply.lua +++ b/xmake/modules/devel/git/apply.lua @@ -42,7 +42,7 @@ function main(patchfile, opt) -- init argv opt = opt or {} - local argv = {"apply", "--reject", patchfile} + local argv = {"apply", "--reject", "--ignore-whitespace", patchfile} -- enter repository directory local oldir = nil |
