TeX-Live / texlive-source

source part of the TeX Live subversion repository - for issues please contact the tex-k mailing list at tug.org
263 stars 68 forks source link

tlmgr: language field is swallowed by details in dumped JSON #2

Closed e-kwsm closed 6 years ago

e-kwsm commented 6 years ago

Revision of tlmgr.pl: 48522; also tested 48598 (f0fa2cd)

For example tlmgr info --json tugboat returns the following JSON (pretty printed and other objects than docfiles are removed)

[
  {
    "docfiles": [
      {
        "file": "texmf-dist/doc/latex/tugboat/README",
        "details": "Readme"
      },
      {
        "file": "texmf-dist/doc/latex/tugboat/ltubguid.ltx"
      },
      {
        "details": "Instructions for authors\" language=\"en",
        "file": "texmf-dist/doc/latex/tugboat/ltubguid.pdf"
      },
      {
        "file": "texmf-dist/doc/latex/tugboat/manifest.txt"
      },
      {
        "details": "Program documentation\" language=\"en",
        "file": "texmf-dist/doc/latex/tugboat/tugboat.pdf"
      }
    ]
  }
]

I expect something like

      {
        "details": "Program documentation",
        "language": "en",
        "file": "texmf-dist/doc/latex/tugboat/tugboat.pdf"
      }

The corresponding lines of my local texlive.tlpdb are

192002  docfiles size=204
192003   texmf-dist/doc/latex/tugboat/README details="Readme"
192004   texmf-dist/doc/latex/tugboat/ltubguid.ltx
192005   texmf-dist/doc/latex/tugboat/ltubguid.pdf details="Instructions for authors" language="en"
192006   texmf-dist/doc/latex/tugboat/manifest.txt
192007   texmf-dist/doc/latex/tugboat/tugboat.pdf details="Program documentation" language="en"

Is this a feature?

norbusan commented 6 years ago

Yes, a very stupid "feature", I'll fix it. Thanks a lot for reporting!

norbusan commented 6 years ago

It's actually not the json routine, but the parser is completely wrong, no idea why ...

norbusan commented 6 years ago

Fix in svn rev 48828, thanks for the report. TLPOBJ.pm needs update

e-kwsm commented 6 years ago

I confirmed rev 48828 fixes the issue. Thank you.