[PATCH 0/3] Minor changes to `channels' field and related doc.

  • Open
  • quality assurance status badge
Details
One participant
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal
T
T
Tomas Volf wrote on 9 May 00:59 +0200
(address . guix-patches@gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
cover.1715208953.git.~@wolfsden.cz
As discussed on mailing list[0], this series contains few minor changes to
documentation, changing the default value to #f and creating new procedure for
actually filling the `channels' field based on the channels.scm file.


Tomas Volf (3):
doc: Warn about extra-special-file usage in /etc.
channels: Add `read-channels-file' procedure.
services: guix: Default `channels' field to #f.

doc/guix.texi | 8 ++++++--
gnu/services/base.scm | 2 +-
guix/channels.scm | 14 +++++++++++++-
guix/scripts/pull.scm | 12 +++---------
4 files changed, 23 insertions(+), 13 deletions(-)

--
2.41.0
T
T
Tomas Volf wrote on 9 May 01:13 +0200
[PATCH 2/3] channels: Add `read-channels-file' procedure.
(address . 70839@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
06234d6dbf04c97da49ecadb8f8d139bf1fe1536.1715208954.git.~@wolfsden.cz
This commit moves non-exported local procedure from (guix pull) in order to
provide a single, canonical way to read a file produced by `guix describe
--format=channels'.

* guix/channels.scm (read-channels-file): New procedure.
(define-module): Export it.
* guix/scripts/pull.scm (channel-list): Use it.

Change-Id: I147fdf3cb177114f4607209de2299f46761b64be
---
guix/channels.scm | 14 +++++++++++++-
guix/scripts/pull.scm | 12 +++---------
2 files changed, 16 insertions(+), 10 deletions(-)

Toggle diff (70 lines)
diff --git a/guix/channels.scm b/guix/channels.scm
index 51024dcad4..38d5c8c325 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -37,6 +37,7 @@ (define-module (guix channels)
#:autoload (guix git-authenticate) (authenticate-repository)
#:autoload (guix openpgp) (openpgp-public-key-fingerprint
openpgp-format-fingerprint)
+ #:autoload (guix ui) (load* make-user-module)
#:use-module (guix base16)
#:use-module (guix records)
#:use-module (guix gexp)
@@ -111,7 +112,9 @@ (define-module (guix channels)
channel-news-entry-title
channel-news-entry-body
- channel-news-for-commit))
+ channel-news-for-commit
+
+ read-channels-file))
;;; Commentary:
;;;
@@ -1086,6 +1089,15 @@ (define* (channel->code channel #:key (include-introduction? #t))
intro))))))
'()))))
+(define (read-channels-file file)
+ "Return channel list read from FILE.
+
+The file shall have format produced by `guix describe --format=channels'."
+ (let ((result (load* file (make-user-module '((guix channels))))))
+ (if (and (list? result) (every channel? result))
+ result
+ (leave (G_ "'~a' did not return a list of channels~%") file))))
+
;;;
;;; News.
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 58d3cd7e83..7240b2f25e 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -750,21 +750,15 @@ (define (channel-list opts)
(define global-file
(string-append %sysconfdir "/guix/channels.scm"))
- (define (load-channels file)
- (let ((result (load* file (make-user-module '((guix channels))))))
- (if (and (list? result) (every channel? result))
- result
- (leave (G_ "'~a' did not return a list of channels~%") file))))
-
(define channels
(cond (file
- (load-channels file))
+ (read-channels-file file))
((and (not ignore-channel-files?)
(file-exists? default-file))
- (load-channels default-file))
+ (read-channels-file default-file))
((and (not ignore-channel-files?)
(file-exists? global-file))
- (load-channels global-file))
+ (read-channels-file global-file))
(else
%default-channels)))
--
2.41.0
T
T
Tomas Volf wrote on 9 May 01:13 +0200
[PATCH 3/3] services: guix: Default `channels' field to #f.
(address . 70839@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
9334845b5b459b34a7b9ce7d56a68629bb333f03.1715208954.git.~@wolfsden.cz
In the absence of the /etc/guix/channels.scm file, %default-channels is used
anyway. If user manually (or by extra-special-file) created the file, we
should respect it. This commit therefore changes the default to #f, hopefully
having zero impact on people not actively using the `channels' field.

* gnu/services/base.scm (<guix-configuration>)[channels]: Set default to #f.

Change-Id: I516c1735a037a153fabbebfc337051aaf0be2155
---
doc/guix.texi | 2 +-
gnu/services/base.scm | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

Toggle diff (28 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 568878ad24..9f422f8212 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19591,7 +19591,7 @@ Base Services
not need it and where the extra boot time is a problem.
@anchor{guix-configuration-channels}
-@item @code{channels} (default: @code{%default-channels})
+@item @code{channels} (default: @code{#f})
List of channels to be specified in @file{/etc/guix/channels.scm}, which
is what @command{guix pull} uses by default (@pxref{Invoking guix
pull}).
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 85160bd3ab..c5f28fd611 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1830,7 +1830,7 @@ (define-record-type* <guix-configuration>
(generate-substitute-key? guix-configuration-generate-substitute-key?
(default #t)) ;Boolean
(channels guix-configuration-channels ;file-like
- (default %default-channels))
+ (default #f))
(chroot-directories guix-configuration-chroot-directories ;list of file-like/strings
(default '()))
(max-silent-time guix-configuration-max-silent-time ;integer
--
2.41.0
T
T
Tomas Volf wrote on 9 May 01:13 +0200
[PATCH 1/3] doc: Warn about extra-special-file usage in /etc.
(address . 70839@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
b1b3ab9d9faa61c9773d8469c201df008dc46b39.1715208954.git.~@wolfsden.cz
* doc/guix.texi (Base Services)[extra-special-file]: Add warning regarding
files in /etc.

Change-Id: Ic45465c8712d61caeed42d7912777368e8763a1a
---
doc/guix.texi | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Toggle diff (26 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index f20208f94f..568878ad24 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -123,7 +123,7 @@
Copyright @copyright{} 2023 Thomas Ieong@*
Copyright @copyright{} 2023 Saku Laesvuori@*
Copyright @copyright{} 2023 Graham James Addis@*
-Copyright @copyright{} 2023 Tomas Volf@*
+Copyright @copyright{} 2023, 2024 Tomas Volf@*
Copyright @copyright{} 2024 Herman Rimm@*
Copyright @copyright{} 2024 Matthew Trzcinski@*
Copyright @copyright{} 2024 Richard Sent@*
@@ -18984,6 +18984,10 @@ Base Services
(extra-special-file "/usr/bin/env"
(file-append coreutils "/bin/env"))
@end lisp
+
+This procedure is meant for @code{/bin/sh}, @code{/usr/bin/env} and
+similar targets. In particular, use for targets under @code{/etc} might
+not work as expected if the target is managed by Guix in other ways.
@end deffn
@defvar host-name-service-type
--
2.41.0
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 70839@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 70839
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch