~sbinet/star-tex#9: 
kpath: add proper support for Context.Open

Paths that are built from an ls-R database are, ultimately, absolute. But the associated kpath.Context may have been created from an fs.FS root that won't be able to recoup the extra leading path.

ctx.fs.Open may thus fail to open the named file because of absolute vs relative path issues. e.g.:

  • ctx.fs is rooted at /usr/share/texmf-dist
  • one requests /usr/share/texmf-dist/foo.txt (which exists) Name is thus "/usr/share/texmf-dist/foo.txt", but from the POV of ctx.fs, only "foo.txt" exists. Giving the absolute path from "/" won't work.

We'd probably need to create an fs.FS that nows its root directory and subtract it from absolute paths that are given to it via Open.

Status
REPORTED
Submitter
~sbinet
Assigned to
No-one
Submitted
3 years ago
Updated
3 years ago
Labels
No labels applied.