diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ced8d9..364ffdb 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +- 2024/04/23 + + - test if referenced files are contained in the `build-dir` directory, use the current dir otherwise. + https://github.com/michal-h21/tex4ebook/issues/126 + - 2024/04/16 - fixed bug in `dvisvgm_hashes` log parsing. On Windows, it didn't expect `\r` characters at the line ends, they then ended in new SVG filenames. diff --git a/mkutils.lua b/mkutils.lua index ec5158d..cf26b0c 100644 --- a/mkutils.lua +++ b/mkutils.lua @@ -107,8 +107,11 @@ function parse_lg(filename, builddir) table.insert(outputimages,rec) end ) - line:gsub("File: (.*)", function(k) - k = dir .. k + line:gsub("File: (.*)", function(x) + local k = dir .. x + if not file_exists(k) then + k = x + end if not usedfiles[k] then table.insert(outputfiles,k) usedfiles[k] = true @@ -244,7 +247,8 @@ end function file_in_builddir(filename, par) if par.builddir and par.builddir ~= "" then - return par.builddir .. "/" .. filename + local newname = par.builddir .. "/" .. filename + return newname end return filename end