Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
can someone explain app-text/mandoc?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1741

PostPosted: Tue Sep 05, 2023 6:30 pm    Post subject: can someone explain app-text/mandoc? Reply with quote

I have noticed some ebuilds now requiring app-text/mandoc (see, for example, dev-libs/libfido2-1.13.0 compared to 1.12.0). First of all, why does the ebuild require mandoc (I see nothing in the ebuild that appears to call it).

I (unfortunately) notice that /var/db/repos/gentoo/virtual/man/man-0-r4.ebuild suggests than mandoc (with the system-man USE flag enabled) can replace sys-apps/man-db:

Code:

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="Virtual for man"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"

RDEPEND="
        || (
                sys-apps/man-db
                >=app-text/mandoc-1.14.5-r1[system-man]
        )
"


So I uninstalled man-db and installed mandoc[system-man]. That did not go well. First of all, I received a warning (saved in an elog file:

Code:

WARN: pretend
only PORTAGE_COMPRESS=gzip or '' is supported, man pages will not be indexed


Using the man command ("man foo") now produces this warning:

Code:

man: outdated mandoc.db lacks foo(1) entry, run makewhatis /usr/share/man


followed by garbage (apparently using the less command, as it shows /tmp/man.XXXX123456 at the bottom of the page).

Running "makewhatis /usr/share/man" changes nothing (I still get the warning).

More surprising, running "less /usr/share/man/man1/foo.1.bz" also produces garbage (before, that command always displayed the man page as well, although in 80-character lines, instead of using the width of my display).

Question (out of curiostiy): Why does less no longer display man pages properly?

The important question: Why does gentoo believe that mandoc satisfies the virtual/man dependency (or do I just have something misconfigured, and some way exists to make it work?)?
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1707

PostPosted: Wed Sep 06, 2023 9:42 am    Post subject: Reply with quote

The upstream build system for libfido2 uses mandoc. Most dependencies are for things the build system needs rather than things the ebuild itself does directly.

Anyway, yes, mandoc as a system man provider only works with no compression or gzip.

Users already have to opt-in to having it take over as a system man provider by setting USE=system-man. See also https://wiki.gentoo.org/wiki/Mandoc#The_system-man_USE_flag.
Back to top
View user's profile Send private message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 922
Location: Romania

PostPosted: Wed Sep 06, 2023 1:28 pm    Post subject: Reply with quote

sam_ wrote:
The upstream build system for libfido2 uses mandoc. Most dependencies are for things the build system needs rather than things the ebuild itself does directly.

Anyway, yes, mandoc as a system man provider only works with no compression or gzip.

Users already have to opt-in to having it take over as a system man provider by setting USE=system-man. See also https://wiki.gentoo.org/wiki/Mandoc#The_system-man_USE_flag.

Good to know about this.
Code:
All selected packages: =x11-libs/libXpm-3.5.16 =dev-libs/libpipeline-1.5.7 =app-arch/ncompress-5.0-r1 =acct-group/man-0-r2 =sys-apps/groff-1.23.0 =acct-user/man-1-r2 =x11-libs/libXaw-1.0.15

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

_________________
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 325
Location: Naarm/Melbourne, Australia

PostPosted: Thu Sep 07, 2023 12:21 am    Post subject: Re: can someone explain app-text/mandoc? Reply with quote

Further to Sam's comment, here's a bug i opened about the compression issue. Given the outcome, i created a "use at your own risk" shell script to facilitate moving from man-db to mandoc.

Regarding:
curmudgeon wrote:
Running "makewhatis /usr/share/man" changes nothing (I still get the warning).

Did you run this as root, or as a regular user? (It requires the former.)
Back to top
View user's profile Send private message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1741

PostPosted: Thu Sep 07, 2023 2:08 am    Post subject: Re: can someone explain app-text/mandoc? Reply with quote

flexibeast wrote:
Further to Sam's comment, here's a bug i opened about the compression issue. Given the outcome, i created a "use at your own risk" shell script to facilitate moving from man-db to mandoc.

Looks like I have found the expert on this. :)

Regarding:
curmudgeon wrote:
Running "makewhatis /usr/share/man" changes nothing (I still get the warning).

Did you run this as root, or as a regular user? (It requires the former.)


I did (of course) run it as root.

After reading a lot of linked pages (and pages referenced from those links), I have a few additional thoughts:

1. The mandoc ebuild should contain a much stronger warning (including at a minimum) a link to https://wiki.gentoo.org/wiki/Mandoc#The_system-man_USE_flag. when run with the system-man USE flag. It should also clearly state that using mandoc to view man pages requires the reinstallation of all packages with man pages with gzip or no compression.

2. I would like to see a portage enhancement to allow users more control over documentation compression (definitely agree with Alexis in the linked bug). Portage should allow users to specify different compression schemes for /usr/share/{doc,info,man}.

3. This looks like another case of "too many tools" in Linux / Unix (how many different compression programs does every Linux system have?). Most annoying here (looking through the build log for libfido2-1.13.0), the mandoc command appears to only get used to create html files (which the libfido2 developer could have done in advance so that everyone building the program didn't have to do that).
Back to top
View user's profile Send private message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 922
Location: Romania

PostPosted: Thu Sep 07, 2023 8:46 am    Post subject: Re: can someone explain app-text/mandoc? Reply with quote

curmudgeon wrote:

3. This looks like another case of "too many tools" in Linux / Unix (how many different compression programs does every Linux system have?).

This is like saying "Why are there so many different sorting algorithms?"
_________________
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20097

PostPosted: Thu Sep 07, 2023 2:48 pm    Post subject: Re: can someone explain app-text/mandoc? Reply with quote

curmudgeon wrote:
This looks like another case of "too many tools" in Linux / Unix (how many different compression programs does every Linux system have?). Most annoying here (looking through the build log for libfido2-1.13.0), the mandoc command appears to only get used to create html files (which the libfido2 developer could have done in advance so that everyone building the program didn't have to do that).
I can sympathize with the sentiment even though I think the compression example is a poor comparison. For my own satisfaction, I checked upstream which thankfully indicates it isn't only for html (that would be irritating): format output for UTF-8 and ASCII UNIX terminals, HTML 5, PostScript, and PDF. If a package is only using for html, hopefully it could be turned off.

The other thing to consider is whether or not the package is expected to be built by a distro which would do the building "so (almost) everyone didn't have to."
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Jimmy Jazz
Guru
Guru


Joined: 04 Oct 2004
Posts: 331
Location: Strasbourg

PostPosted: Fri Sep 08, 2023 3:19 pm    Post subject: Re: can someone explain app-text/mandoc? Reply with quote

curmudgeon wrote:
...
Code:

WARN: pretend
only PORTAGE_COMPRESS=gzip or '' is supported, man pages will not be indexed


that's it!

add/change in portage make.conf file/dir PORTAGE_COMPRESS=gzip and update over 600 packages that generate man pages !

I suppose man are bz2 compressed et gentoo has updated to the lastest packages.

Code:
find /usr/share/man  /usr/lib/llvm/16/share/man /usr/share/postgresql/man /etc/java-config-2/current-system-vm/man /usr/share/gcc-data/x86_64-pc-linux-gnu/13/man /usr/share/binutils-data/x86_64-pc-linux-gnu/2.41/man -name '*.bz2' > /tmp/a
equery b $(</tmp/a) | uniq > /tmp/todo
emerge -a1v $(sed 's/^/=/' /tmp/todo)


MANPAGER should be changed accordintly (mman doesn't support vim manpager)
_________________
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke
Code:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
Leonardo.b
Guru
Guru


Joined: 10 Oct 2020
Posts: 302

PostPosted: Fri Sep 08, 2023 6:40 pm    Post subject: Reply with quote

You could re-compress your manuals, and later play sed awk kung-fu to fix Portage database.
There be dragons, beware you might break everything, this is not the safe route.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum