Tíquete #42178

Move man page .so requests to first lines, to let compressed man pages work

: 2021-05-05 09:51 Última Atualização: 2021-05-08 10:50

Relator:
Dono:
(Nenhum)
Tipo:
Estado:
Aberto
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Accepted
Arquivo:
4

Details

On at least one distribution of Freeciv, MacPorts, some freeciv man pages fail with an error message like, "can't open `man6/freeciv-client.6': No such file or directory". This is because of two choices conflicting: 1) Freeciv authors man pages for the individual clients as stubs which use a .so request to include another man page source file, e.g. freeciv-client.6. 2) MacPorts compresses man pages when it installs them, changing filenames from e.g. freeciv-client.6 to freeciv-client.6.gz. These choices conflict. Freeciv can work around this by moving the .so request to the start of each stub man file.

How to reproduce

  1. Use MacPorts to Install their freeciv or freeciv-x11 ports on a macOS computer.
  2. From a command line, enter man freeciv-gtk2

Observed behaviour

<standard input>:14: can't open `man6/freeciv-client.6': No such file or directory

(END)

Expected behaviour

The same page appears as when one commands, man freeciv-client.

Discussion

Any of the stub man pages, freeciv-gtk2, freeciv-gtk3.22, freeciv-gtk3, freeciv-mp-cli, freeciv-mp-gtk2, freeciv-mp-gtk3, freeciv-mp-qt, freeciv-qt, freeciv-ruledit, freeciv-sdl, freeciv-sdl2, freeciv-xaw, will fail in a similar way.

All these pages appear to consist only of a few lines of comments, then a troff "include file" directive of the form,

.\" Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
.\"   This program is free software; you can redistribute it and/or modify
…[left out for brevity]…
.\"   GNU General Public License for more details.
.\"
.so man6/freeciv-client.6

The stubs might refer to man6/freeciv-modpack.6 instead, depending on the stub.

MacPorts compresses all man pages as it installs them. Thus the filename for freeciv-client becomes man6/freeciv-client.6.gz. Apparently, man cannot recognise the pattern. Instead of appending a .gz extension and finding the freeciv-client file, it fails instead.

I took a look at the Groff project mailing list archives. This is not the first time the issue of compressed man pages has come up. A thread there went through a lot of the issues I am encountering: "{Groff} {groff/patch} transparent gzip" ​. A message there alluded to a workaround: "If you look at the source code of man itself, you will find that there is extra provision for file with a single .so in the first line. Just grp for .so anywhere else, you'll encounter problems. Examples are zshall, as well as all the pvm man pages, and a dozen of sporadic ones."

I tried altering a Freeciv man page by moving its .so request to the first line of the file, and compressed that.

.so man6/freeciv-client.6
.\" Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
.\"   This program is free software; you can redistribute it and/or modify
…[left out for brevity]…
.\"   GNU General Public License for more details.
.\"
man freeciv-gtk2 then succeeded. Thus I propose changing every one of Freeciv's stub man pages in this way.

There is a MacPorts ticket tracking this issue, #62798 ''freeciv 2.6.4: man freeciv-gtk2 etc. "can't open" "No such file or directory" (.so directive and .gz?)''

Ticket History (3/7 Histories)

2021-05-05 09:51 Updated by: jdlh
  • New Ticket "Move man page .so requests to first lines, to let compressed man pages work" created
2021-05-05 10:28 Updated by: cazfi
  • Marco Update from (Nenhum) to 2.6.5

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login