tlmgr search output

Marei Peischl tex at mareipeischl.de
Wed Apr 24 09:17:17 CEST 2024


On 4/24/24 9:06 AM, Joseph Wright wrote:
> On 24/04/2024 08:02, Marei Peischl via tex-live wrote:
>> Hi Joseph,
>>
>> On 4/24/24 8:36 AM, Joseph Wright wrote:
>>> Hello all,
>>>
>>> There was a question on TeX-sx yesterday about automatically 
>>> determining
>>> 'CTAN' (TeX Live really) packages needed by a document. I started on a
>>> script with the idea of being to use --recorder, parse the .fls file
>>> then do a lookup for each line to list all of the TL packages needed.
>>> That would be handy for anyone using a deliberately minimised TeX 
>>> system.
>>>
>>> However, I ran into the issue that
>>>
>>>     tlmgr search --global --file <filename>
>>>
>>> doesn't return anything I can use from a script - try e.g.
>>
>> Do you need the --global here?
>
> It depends on the use case, but I suspect so - if you have an existing
> full TL setup and are sending information to someone else with a
> minimised setup, they need to get the *current* TL package with the
> file. That might not match what you have if there have been
> re-arrangements of the files in TL/CTAN in the time since you did your
> installation.

That's true. But that would still be an issue as the dependencies might 
change as well in that time. So you would always have to get the latest …

Our idea was to provide that mechanism as some kind of pipeline so you 
can use it within your projects via CI to keep that up to date. Using it 
locally will always have that issue.

>
>> I use that via shell-escape in a container running a full TeX Live to
>> detect without using --recorder
>
> "That"?
\sys_get_shell:nnN {tlmgr~search~--file~/article.cls} {} \l_tmpa_tl

And then drop everything after the colon.

Shame on me I now tried your snipped and realized why I put the slash 
there. This will drop all subtring matches. So you really only get the 
article one. Then your probably understand my next stop.

>
>> Then the output is by far more usable. Maybe that helps. Alternatively
>> one can set the tlmgr repo to be able to predict the string before the
>> package
> The .fls file is quite easy to read - I'm not sure what you mean here.

The upper gives me

latex:texmf-dist/tex/latex/base/article.clslatex-base-dev:
texmf-dist/tex/latex-dev/base/article.cls.

and with global I get

tlmgr:packagerepositoryhttps://ftp.tu-chemnitz.de/pub/tex/systems/te
xlive/tlnet(verified)latex:texmf-dist/tex/latex/base/article.cls

The repo stirng is something one can detect. So I think the slash is 
what you anted.

>
>> Could turn that repo public already in case you think it might help but
>> it's rather alpha state I guess and a bit chaotic atm.
>
> You could just add me for the present ;)

Will do. But probably the slash will already do it.

Marei

>
> Joseph
>
>
>


More information about the tex-live mailing list.