* [bug#62103] [PATCH 0/2] redundant system degexp
@ 2023-03-10 20:16 Bruno Victal
2023-03-10 20:21 ` [bug#62103] [PATCH 1/2] system: Simplify nsswitch binding Bruno Victal
2023-03-10 20:21 ` [bug#62103] [PATCH 2/2] system: Remove redundant gexp-ungexp usage Bruno Victal
0 siblings, 2 replies; 4+ messages in thread
From: Bruno Victal @ 2023-03-10 20:16 UTC (permalink / raw)
To: 62103; +Cc: Bruno Victal, ludo
I tested these changes with:
make check-system TESTS=basic
make check-system TESTS=nss-mdns
Bruno Victal (2):
system: Simplify nsswitch binding.
system: Remove redundant gexp-ungexp usage.
gnu/system.scm | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
base-commit: f7682c247504d252cf86b274ffe7b8f62670b497
--
2.39.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [bug#62103] [PATCH 1/2] system: Simplify nsswitch binding.
2023-03-10 20:16 [bug#62103] [PATCH 0/2] redundant system degexp Bruno Victal
@ 2023-03-10 20:21 ` Bruno Victal
2023-03-10 20:21 ` [bug#62103] [PATCH 2/2] system: Remove redundant gexp-ungexp usage Bruno Victal
1 sibling, 0 replies; 4+ messages in thread
From: Bruno Victal @ 2023-03-10 20:21 UTC (permalink / raw)
To: 62103; +Cc: ludo, Bruno Victal
* gnu/system.scm (operating-system-etc-service): Simplify nsswitch binding.
---
gnu/system.scm | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gnu/system.scm b/gnu/system.scm
index bb26d7c9a5..2947d1321f 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1001,10 +1001,9 @@ (define* (operating-system-etc-service os)
(hurd (operating-system-hurd os))
(issue (plain-file "issue" (operating-system-issue os)))
- (nsswitch (operating-system-name-service-switch os))
- (nsswitch (and nsswitch
- (plain-file "nsswitch.conf"
- (name-service-switch->string nsswitch))))
+ (nsswitch (and=> (operating-system-name-service-switch os)
+ (compose (cut plain-file "nsswitch.conf" <>)
+ name-service-switch->string)))
(sudoers (operating-system-sudoers-file os))
;; Startup file for POSIX-compliant login shells, which set system-wide
base-commit: f7682c247504d252cf86b274ffe7b8f62670b497
--
2.39.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#62103] [PATCH 2/2] system: Remove redundant gexp-ungexp usage.
2023-03-10 20:16 [bug#62103] [PATCH 0/2] redundant system degexp Bruno Victal
2023-03-10 20:21 ` [bug#62103] [PATCH 1/2] system: Simplify nsswitch binding Bruno Victal
@ 2023-03-10 20:21 ` Bruno Victal
2023-03-13 11:30 ` bug#62103: " Ludovic Courtès
1 sibling, 1 reply; 4+ messages in thread
From: Bruno Victal @ 2023-03-10 20:21 UTC (permalink / raw)
To: 62103; +Cc: ludo, Bruno Victal
* gnu/system.scm (os-release): Convert to variable.
(operating-system-etc-service): Remove redundant gexp-ungexps.
---
gnu/system.scm | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/gnu/system.scm b/gnu/system.scm
index 2947d1321f..887e537b48 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -967,9 +967,8 @@ (define (validated-sudoers-file file)
"--check" "--file" #$file)
(copy-file #$file #$output)))))
-(define (os-release)
- (plain-file "os-release"
- "\
+(define os-release
+ (plain-file "os-release" "\
NAME=\"Guix System\"
ID=guix
PRETTY_NAME=\"Guix System\"
@@ -1092,15 +1091,15 @@ (define* (operating-system-etc-service os)
source /run/current-system/profile/etc/profile.d/bash_completion.sh
fi\n")))
(etc-service
- `(("os-release" ,#~#$(os-release))
+ `(("os-release" ,os-release)
("services" ,(file-append net-base "/etc/services"))
("protocols" ,(file-append net-base "/etc/protocols"))
("rpc" ,(file-append net-base "/etc/rpc"))
- ("login.defs" ,#~#$login.defs)
- ("issue" ,#~#$issue)
- ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
- ("profile" ,#~#$profile)
- ("bashrc" ,#~#$bashrc)
+ ("login.defs" ,login.defs)
+ ("issue" ,issue)
+ ,@(if nsswitch `(("nsswitch.conf" ,nsswitch)) '())
+ ("profile" ,profile)
+ ("bashrc" ,bashrc)
;; Write the operating-system-host-name to /etc/hostname to prevent
;; NetworkManager from changing the system's hostname when connecting
;; to certain networks. Some discussion at
--
2.39.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#62103: [PATCH 2/2] system: Remove redundant gexp-ungexp usage.
2023-03-10 20:21 ` [bug#62103] [PATCH 2/2] system: Remove redundant gexp-ungexp usage Bruno Victal
@ 2023-03-13 11:30 ` Ludovic Courtès
0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2023-03-13 11:30 UTC (permalink / raw)
To: Bruno Victal; +Cc: 62103-done
Hi Bruno,
Bruno Victal <mirai@makinata.eu> skribis:
> * gnu/system.scm (os-release): Convert to variable.
> (operating-system-etc-service): Remove redundant gexp-ungexps.
[...]
> * gnu/system.scm (operating-system-etc-service): Simplify nsswitch binding.
Applied, thanks!
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-13 11:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 20:16 [bug#62103] [PATCH 0/2] redundant system degexp Bruno Victal
2023-03-10 20:21 ` [bug#62103] [PATCH 1/2] system: Simplify nsswitch binding Bruno Victal
2023-03-10 20:21 ` [bug#62103] [PATCH 2/2] system: Remove redundant gexp-ungexp usage Bruno Victal
2023-03-13 11:30 ` bug#62103: " Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).