Closed thomasjo closed 2 years ago
As a side note, while working on this I noticed that our clean-related tests are quite lacking, and due to the use of the mocked getGeneratedFileList
implementation is likely hiding many other bugs. We should strongly reconsider how and when we're mocking crucial infrastructure. At the very least, if we want to keep the current mock, we should add several positive and negative test that only target Composer.getGeneratedFileList
to ensure we're fully covering all scenarios.
Bug discovered by @Doekab in #462. This bug has been around for a very long time, but somehow nobody has encountered it before now. The basis gist of the bug is as follows;
file.tex
is a valid LaTeX document that compiles, and that the build process produces some auxiliary files, of which one isfile.pdf
.file.pdf
tofile x.pdf
.latex:clean
command, the renamedfile x.pdf
is incorrectly cleaned due to the overzealous glob pattern.The proposed fix is simply replacing the very greedy glob pattern with a slightly less greedy pattern that only does wildcard matching on file extensions. Note that strictly speaking, the proposed fix is probably still susceptible to issues with files named e.g.
file.some.thing.log
, but that will have to be verified and fixed at some later stage.