Consistency suggestion tlpdb

Yann Denichou yann.denichou.latex at protonmail.com
Tue Jul 23 00:29:09 CEST 2024


Le dimanche 21 juillet 2024 à 15:44, Norbert Preining <norbert at preining.info> a écrit :

> Hi Yann

Hi Norbert,

> > I use it to create a database for the fortune program, then I can have a random package description each time I open a terminal on my Linux machine :)
> 
> 
> Hahaha, what an ingenious usage! Thanks for sharing.

You're welcome! :)

> I took a quick look at your code, and my wild wild guess it that it is
> probably easier to use
> tlmgr info --json
> to get the whole db info as json, and then just query with jq from bash.
> 
> Another option would be to just use grep/awk etc on the texlive.tlpdb
> file itself. You could get the location with
> $(kpsewhich -var-value TEXMFROOT)/tlpkg/texlive.tlpdb
> That will be much faster than booting up tlmgr just for dumping the
> tlpdb.
> 
> But all this are just wild guesses from my side ;-)
> 
> Thanks again, and let me know if you would prefer anything else!

Thank you very much for your guesses!

I think the `tlmgr info --json` will be perfect for the second part of my future article: I also want to demonstrate how to create (with a python script) a tex document which lists all packages (and their description, license, etc.) of a given topic (I did that a few years ago using `tlmgr dump-tlpdb --json`, I guess I just have to rework it little bit).

For the fortune thing, it might be cool to use `tlmgr info --json` for grabbing more information such as version or license! But I will have to convert it to the "dump-tlpdb" format or save the fortune db in json and rewrite my formatting script.

Thanks for the trick for getting the tlpdb file! By curiosity, I run a diff on this file and a `tlmgr dump-tlpdb --local > other-file.txt` and I found a "unicode bug" in the longdesc of the hyphen-finnish package: the quotes are replaced by "â".

Before reading your email, I began using (and learning) awk to replace the perl script for filtering the db. It's a simpler solution, and maybe I will stick with it for the moment because it seems to be a lot more of work to pass to `tlmgr info --json` (and I have to use LaTeX to prepare my documents for my first year of teaching maths before the end of summer). Nevertheless, I keep that json solution in the back of my mind (and in my README).

Best regards,

Yann Denichou

PS: Thanks for your really interesting talks at the TUG 2024 (I just finished watching the replays).



More information about the tex-live mailing list.