diff options
author | Tomas Volf <~@wolfsden.cz> | 2024-07-07 19:27:47 +0200 |
---|---|---|
committer | Guix Patches Tester <> | 2024-07-07 20:44:32 +0200 |
commit | 60ff45e341a661521433344a809ebd98b5ad168d (patch) | |
tree | 6075b80912e14a7148820323a3f74ad99ac0dd00 | |
parent | c86a07bacc2469e7a00fbc66cfe4f322e4bafb06 (diff) | |
download | guix-patches-issue-71981.tar guix-patches-issue-71981.tar.gz |
services: configuration: Produce doc even if package->symbol fails.issue-71981
Due to #71979 it can happen that package->symbol can return #f even for
packages that are defined in modules on the load patch and which were
previously loaded and set as a default value.
In that case we can just return (package-name val), since for the purpose of
illustrating the default value in the documentation the name should suffice.
And having (possibly) slightly misleading documentation property is still
better then `guix pull' just failing due to passing #f to symbol->string.
* gnu/services/configuration.scm (generate-documentation)[package?]: Fall back
to package-name if package->symbol fails.
Change-Id: I9987caf40d3ff62a52cbd6e3325aa42c69a6c47a
-rw-r--r-- | gnu/services/configuration.scm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index d2b1687496..a0e6fe206f 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -445,7 +445,14 @@ DEFAULT." (define (show-default val) (cond ((package? val) - (symbol->string (package->symbol val))) + (let ((sym (package->symbol val))) + ;; Work around for #71979. While in the alternate + ;; the answer will not always match the symbol, it + ;; should be good enough for illustrating the default + ;; value in documentation. + (if sym + (symbol->string sym) + (package-name val)))) (((list-of package?) val) (format #f "(~{~a~^ ~})" (map package->symbol val))) (else (str val)))) |