Message ID | 20211026173328.21511-1-ludo@gnu.org |
---|---|
State | Accepted |
Headers | show |
Series | [bug#51416] profiles: Build the man database only if 'man-db' is in the profile. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
On Tue, Oct 26, 2021 at 07:33:28PM +0200, Ludovic Courtès wrote: > The other day Liliana came with a smart idea on IRC: to build the database > only when ‘man-db’ is also in the profile. It’s a good way to not quite > make a decision :-), but it’s going to address the main pain point. > > Thoughts? From the user's perspective, what would change? Would `man foo` still work after installing foo?
Leo Famulari <leo@famulari.name> skribis: > On Tue, Oct 26, 2021 at 07:33:28PM +0200, Ludovic Courtès wrote: >> The other day Liliana came with a smart idea on IRC: to build the database >> only when ‘man-db’ is also in the profile. It’s a good way to not quite >> make a decision :-), but it’s going to address the main pain point. >> >> Thoughts? > >>From the user's perspective, what would change? Would `man foo` still > work after installing foo? Yes. What wouldn’t work, unless ‘man-db’ is in the same profile, is ‘man -k whatever’: https://guix.gnu.org/manual/en/html_node/Documentation.html On Guix System, the system profile does include man-db by default. Ludo’.
On Tue, Oct 26, 2021 at 11:50:54PM +0200, Ludovic Courtès wrote: > Yes. What wouldn’t work, unless ‘man-db’ is in the same profile, is > ‘man -k whatever’: > > https://guix.gnu.org/manual/en/html_node/Documentation.html > > On Guix System, the system profile does include man-db by default. Wow, I never knew about that feature. I figured the database was necessary for `man foo`. +1 for this change!
Hi, Ludovic Courtès <ludo@gnu.org> writes: […] > https://guix.gnu.org/manual/en/html_node/Documentation.html > > On Guix System, the system profile does include man-db by default. We probably should add a line in the documentation about 'man -k' requirement on non Guix system, WDYT? Otherwise +1 for the change. Oleg.
Hi, Oleg Pykhalov <go.wigust@gmail.com> skribis: > Ludovic Courtès <ludo@gnu.org> writes: > > […] > >> https://guix.gnu.org/manual/en/html_node/Documentation.html >> >> On Guix System, the system profile does include man-db by default. > > We probably should add a line in the documentation about 'man -k' > requirement on non Guix system, WDYT? Otherwise +1 for the change. Yes, good idea, I’ll do that. Thanks! Ludo’.
Hi, Ludovic Courtès <ludo@gnu.org> skribis: > Oleg Pykhalov <go.wigust@gmail.com> skribis: > >> Ludovic Courtès <ludo@gnu.org> writes: >> >> […] >> >>> https://guix.gnu.org/manual/en/html_node/Documentation.html >>> >>> On Guix System, the system profile does include man-db by default. >> >> We probably should add a line in the documentation about 'man -k' >> requirement on non Guix system, WDYT? Otherwise +1 for the change. > > Yes, good idea, I’ll do that. Done in 3c1158ac4e5ef825a9b9a229a233fabd7cef334e! Thanks, Ludo’.
diff --git a/guix/profiles.scm b/guix/profiles.scm index 9f30349c69..ffdd5f57f6 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1682,6 +1682,16 @@ (define man-directory `((type . profile-hook) (hook . manual-database)))) +(define (manual-database/optional manifest) + "Return a derivation to build the manual database of MANIFEST, but only if +MANIFEST contains the \"man-db\" package. Otherwise, return #f." + ;; Building the man database (for "man -k") is expensive and rarely used. + ;; Build it only if the profile also contains "man-db". + (mlet %store-monad ((man-db (manifest-lookup-package manifest "man-db"))) + (if man-db + (manual-database manifest) + (return #f)))) + (define (texlive-configuration manifest) "Return a derivation that builds a TeXlive configuration for the entries in MANIFEST." @@ -1784,7 +1794,7 @@ (define %default-profile-hooks ;; This is the list of derivation-returning procedures that are called by ;; default when making a non-empty profile. (list info-dir-file - manual-database + manual-database/optional fonts-dir-file ghc-package-cache-file ca-certificate-bundle