speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
293 stars 36 forks source link

files in subdirectories #499

Closed pr-apes closed 1 year ago

pr-apes commented 1 year ago

@pgundlach,

sometimes I have to invoke Publisher such as in:

sp --dummy --autoopen -v pdfdoc=./a.pdf

I have to force the current directory, because if there is any */a.pdf (a file named the same way in a subdirectory), Publisher selects it as variable value.

Sorry, if this is not a bug, I cannot see the reason of the gain in such a feature.

Many thanks for your help.

pgundlach commented 1 year ago

I am not sure I understand / can reproduce the problem.

I have a "out.pdf" in my current directory and another one in a subdirectory. When I invoke

sp --dummy --autoopen -v pdfdoc=./out.pdf, the variable is set to ./out.pdf, when I run sp --dummy --autoopen -v pdfdoc=out.pdf, the variable contains the string out.pdf.

I this not what is expected?

pr-apes commented 1 year ago

Sorry for my inaccuracy, the whole thing is more subtle.

If I run sp --dummy --autoopen -v pdfdoc=out.pdf and I have ./out.pdf and ./helloworld/out.pdf, the variable might be right, but ./helloworld/out.pdf is the file selected in Publisher.

I hope it is clear now.

pgundlach commented 1 year ago

selected where? When loading an image? This has nothing to do with -v ..., just the “normal” loading behaviour. If there are more resources with the same name, you have to resolve them with absolute paths or selectively add / remove directories from the recursive file search.

pr-apes commented 1 year ago

Yes, selected when loading an image.

Sorry, the variable was only my way of naming what it seems to be recursive file search.

This is the first time I experience that a file in the current directory is ignored in favor of the same file name in a subdirectory.

As far as I know, LuaTeX doesn't do recursive file searches (at least, from what I have experienced in ConTeXt).

I have just noticed that --no-local disables these recursive file searches (which would have been a more consistent default).

pgundlach commented 1 year ago

The recursive file search is a feature which I miss from LuaTeX et. al. and is a design choice which was there right from the beginning (and will be also part of XTS). I should issue a warning if there are duplicate file names found in the database.

I think this issue can be closed?

pr-apes commented 1 year ago

Sorry, but I think this is the first time I found recursive file search in the terminal.

I think it might be surprising (to say the least) to select a file in a subdirectory over a file in the current directory.

But a warning on duplicate files would be really desirable (if recursive file search has to be the default).

pr-apes commented 1 year ago

Closing the issue myself.