GNU bug report logs - #77387
[PATCH 0/2] man-db: Better parsing of man macros.

Previous Next

Package: guix-patches;

Reported by: Sergey Trofimov <sarg <at> sarg.org.ru>

Date: Sun, 30 Mar 2025 14:27:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#77387: closed ([PATCH 0/2] man-db: Better parsing of man macros.)
Date: Fri, 11 Apr 2025 10:19:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 11 Apr 2025 12:05:58 +0200
with message-id <87zfgnm2rd.fsf <at> gnu.org>
and subject line Re: [bug#77387] [PATCH v2 1/2] man-db: Parse man macro arguments better.
has caused the debbugs.gnu.org bug report #77387,
regarding [PATCH 0/2] man-db: Better parsing of man macros.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
77387: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77387
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Sergey Trofimov <sarg <at> sarg.org.ru>
To: guix-patches <at> gnu.org
Cc: Sergey Trofimov <sarg <at> sarg.org.ru>
Subject: [PATCH 0/2] man-db: Better parsing of man macros.
Date: Sun, 30 Mar 2025 16:25:46 +0200
Hey guix, I've noticed that quite a lot man pages are reported to belong to a wrong section by `man -k`:

--8<---------------cut here---------------start------------->8---
$ man -k "" | grep "(0)"
...
ssh-pkcs11-helper (0) - (unknown subject)
ssh-sk-helper (0)    - (unknown subject)
ssh_config (0)       - (unknown subject)
sshd (0)             - (unknown subject)
sshd_config (0)      - (unknown subject)
sudo (0)             - (unknown subject)
sudo.conf (0)        - (unknown subject)
tc-cgroup (0)        - control group based traffic control filter
tc-connmark (0)      - (unknown subject)
...
--8<---------------cut here---------------end--------------->8---

A side-effect of it is that `M-x man` doesn't list such pages in auto-completion. I've attempted to fix that, see the following patch.

With the patch `man -k` and `M-x man` work properly:

--8<---------------cut here---------------start------------->8---
$ man -k sudo
cvtsudoers (1)       - (unknown subject)
sudo (8)             - (unknown subject)
sudo.conf (5)        - (unknown subject)
sudo_logsrv.proto (5) - (unknown subject)
sudo_logsrvd (8)     - (unknown subject)
...
--8<---------------cut here---------------end--------------->8---


Note, that synopsis extraction also needs improvement, however it turns out to
be more complicated as proper formatting requires cleaning up / expanding macros.

Sergey Trofimov (2):
  man-db: Parse man macro arguments better.
  man-db: Support mdoc-formatted man pages.

 guix/man-db.scm | 52 ++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 43 insertions(+), 9 deletions(-)


base-commit: 2ed28b5c24c599b2f9bc60dfc93151cf489ca477
-- 
2.49.0



[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, 77387-done <at> debbugs.gnu.org,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#77387] [PATCH v2 1/2] man-db: Parse man macro arguments
 better.
Date: Fri, 11 Apr 2025 12:05:58 +0200
Hi,

I applied v2, thank you!

I confirmed that this goes from:

--8<---------------cut here---------------start------------->8---
$ guix describe
Generation 342  Apr 06 2025 23:07:09    (current)
  shepherd d98d61a
    repository URL: https://git.savannah.gnu.org/git/shepherd.git
    branch: main
    commit: d98d61a8a3f20de46d18ce4a8af05c93fab20b89
  guile af96820
    repository URL: https://git.savannah.gnu.org/git/guile.git
    branch: main
    commit: af96820e072d18c49ac03e80c6f3466d568dc77d
  guix 6af6806
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 6af680670bf9055b90e6f8b63c4c2ab7b08e7c56
ludo <at> ribbon ~/src/guix$ guix shell man-db openssh -C -- man -k ssh
ssh (0)              - (unknown subject)
ssh-add (0)          - (unknown subject)
ssh-agent (0)        - (unknown subject)
ssh-copy-id (0)      - (unknown subject)
ssh-keygen (0)       - (unknown subject)
ssh-keyscan (0)      - (unknown subject)
ssh-keysign (0)      - (unknown subject)
ssh-pkcs11-helper (0) - (unknown subject)
ssh-sk-helper (0)    - (unknown subject)
ssh_config (0)       - (unknown subject)
sshd (0)             - (unknown subject)
sshd_config (0)      - (unknown subject)
--8<---------------cut here---------------end--------------->8---

… to:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix shell man-db openssh -C -- man -k ssh
ssh (1)              - (unknown subject)
ssh-add (1)          - (unknown subject)
ssh-agent (1)        - (unknown subject)
ssh-copy-id (1)      - (unknown subject)
ssh-keygen (1)       - (unknown subject)
ssh-keyscan (1)      - (unknown subject)
ssh-keysign (8)      - (unknown subject)
ssh-pkcs11-helper (8) - (unknown subject)
ssh-sk-helper (8)    - (unknown subject)
ssh_config (5)       - (unknown subject)
sshd (8)             - (unknown subject)
sshd_config (5)      - (unknown subject)
--8<---------------cut here---------------end--------------->8---

… which will undoubtedly be more convenient.  :-)

Thanks!

Ludo’.


This bug report was last modified 39 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.