[PATCH core-updates 0/3] Some installer fixes

  • Done
  • quality assurance status badge
Details
2 participants
  • Josselin Poiret
  • Ludovic Courtès
Owner
unassigned
Submitted by
Josselin Poiret
Severity
normal
J
J
Josselin Poiret wrote on 24 Apr 2023 21:42
(address . guix-patches@gnu.org)(name . Josselin Poiret)(address . dev@jpoiret.xyz)
cover.1682364024.git.dev@jpoiret.xyz
Hello everyone,

This patchset contains one installer fix (the second patch), while both of the
other patches are fixes that should make installer debugging slightly easier.
Since (current-guix) inherits the system's sysconfdir, that config variable
needs to be set properly as well (so /etc for most installs, and not the
default /usr/local/etc). Also, the acl file should be placed by the guix
service in the correct spot, to account for sysconfdirs different from /etc.

NB: I'm testing the new `mumi` CLI with this patchset.

Best,

Josselin Poiret (3):
system: guix: Use config's ACL file location.
installer: Filter out C.UTF-8 from the list of locales.
doc: Add --sysconfdir=/etc to the recommended ./configure.

doc/contributing.texi | 2 +-
gnu/installer/locale.scm | 7 ++++---
gnu/services/base.scm | 17 +++++++++--------
3 files changed, 14 insertions(+), 12 deletions(-)


base-commit: 9e81b4da2d0626426d8d7b392b1e88caf5eb0161
--
2.39.2
J
J
Josselin Poiret wrote on 24 Apr 2023 21:59
[PATCH core-updates 2/3] installer: Filter out C.UTF-8 from the list of locales.
d5313e2e92a57458cce0696f3188b077184aa064.1682364024.git.dev@jpoiret.xyz
* gnu/installer/locale.scm (supported-locales->locales): Filter out C.UTF-8. It
doesn't follow the other locales' format, and doesn't have a corresponding
iso639 code.
---
gnu/installer/locale.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Toggle diff (20 lines)
diff --git a/gnu/installer/locale.scm b/gnu/installer/locale.scm
index ccffb6d8ef..2ec0598abb 100644
--- a/gnu/installer/locale.scm
+++ b/gnu/installer/locale.scm
@@ -93,9 +93,10 @@ (define (locale->locale-string locale)
(define (supported-locales->locales supported-locales)
"Given SUPPORTED-LOCALES, a file produced by 'glibc-supported-locales',
return a list of locales where each locale is an alist."
- (map (match-lambda
- ((locale . codeset)
- (locale-string->locale locale codeset)))
+ (filter-map (match-lambda
+ (("C.UTF-8" . codeset) #f)
+ ((locale . codeset)
+ (locale-string->locale locale codeset)))
(call-with-input-file supported-locales read)))
--
2.39.2
J
J
Josselin Poiret wrote on 24 Apr 2023 21:59
[PATCH core-updates 1/3] system: guix: Use config's ACL file location.
e1effe129a8561082a0cf59a84004737a9fda308.1682364024.git.dev@jpoiret.xyz
* gnu/services/base.scm (substitute-key-authorization): Use %acl-file instead of
hardcoded "/etc/guix/acl".
---
gnu/services/base.scm | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

Toggle diff (42 lines)
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index e8eae72aa2..4adb551796 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -83,6 +83,7 @@ (define-module (gnu services base)
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (guix modules)
+ #:use-module (guix pki)
#:use-module ((guix self) #:select (make-config.scm))
#:use-module (guix diagnostics)
#:use-module (guix i18n)
@@ -1727,19 +1728,19 @@ (define keys
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
-
+ (define acl-file #$%acl-file)
;; If the ACL already exists, move it out of the way. Create a backup
;; if it's a regular file: it's likely that the user manually updated
;; it with 'guix archive --authorize'.
- (if (file-exists? "/etc/guix/acl")
- (if (and (symbolic-link? "/etc/guix/acl")
- (store-file-name? (readlink "/etc/guix/acl")))
- (delete-file "/etc/guix/acl")
- (rename-file "/etc/guix/acl" "/etc/guix/acl.bak"))
- (mkdir-p "/etc/guix"))
+ (if (file-exists? acl-file)
+ (if (and (symbolic-link? acl-file)
+ (store-file-name? (readlink acl-file)))
+ (delete-file acl-file)
+ (rename-file acl-file (string-append acl-file ".bak")))
+ (mkdir-p (dirname acl-file)))
;; Installed the declared ACL.
- (symlink #+default-acl "/etc/guix/acl"))))
+ (symlink #+default-acl acl-file))))
(define %default-authorized-guix-keys
;; List of authorized substitute keys.
--
2.39.2
J
J
Josselin Poiret wrote on 24 Apr 2023 21:59
[PATCH core-updates 3/3] doc: Add --sysconfdir=/etc to the recommended ./configure.
92b4dd720cdddc4756c8000eb8090955046a410b.1682364024.git.dev@jpoiret.xyz
* doc/contributing.texi (Building from Git): Add --sysconfdir=/etc to the
recommended ./configure invocation.
---
doc/contributing.texi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/doc/contributing.texi b/doc/contributing.texi
index 73d1cd2648..2a30b5055a 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -130,7 +130,7 @@ more information.
Then, run:
@example
-./configure --localstatedir=/var
+./configure --localstatedir=/var --sysconfdir=/etc
@end example
@noindent
--
2.39.2
L
L
Ludovic Courtès wrote on 30 Apr 2023 23:12
Re: bug#63057: [PATCH core-updates 0/3] Some installer fixes
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 63057-done@debbugs.gnu.org)
87h6sxoz1a.fsf@gnu.org
Hi,

Josselin Poiret <dev@jpoiret.xyz> skribis:

Toggle quote (7 lines)
> This patchset contains one installer fix (the second patch), while both of the
> other patches are fixes that should make installer debugging slightly easier.
> Since (current-guix) inherits the system's sysconfdir, that config variable
> needs to be set properly as well (so /etc for most installs, and not the
> default /usr/local/etc). Also, the acl file should be placed by the guix
> service in the correct spot, to account for sysconfdirs different from /etc.

All good ideas.

Toggle quote (2 lines)
> NB: I'm testing the new `mumi` CLI with this patchset.

Oh, I need to give it a spin!

Toggle quote (4 lines)
> system: guix: Use config's ACL file location.
> installer: Filter out C.UTF-8 from the list of locales.
> doc: Add --sysconfdir=/etc to the recommended ./configure.

Applied, thanks!

Ludo’.
Closed
?