GNU bug report logs -
#49419
[PATCH 0/4] Essential home services
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Maxime Devos <maximedevos <at> telenet.be> writes:
> Hi,
>
> Andrew Tropin schreef op ma 05-07-2021 om 18:37 [+0300]:
>> + (if (file-exists? (he-init-file new-home))
>> + (let* ((port ((@@ (ice-9 popen) open-input-pipe)
>> + (format #f "source ~a && env"
>> + (he-init-file new-home))))
>> + (result ((@@ (ice-9 rdelim) read-delimited) "" port))
>> + (vars (map (lambda (x)
>> + (let ((si (string-index x #\=)))
>> + (cons (string-take x si)
>> + (string-drop x (1+ si)))))
>> + ((@@ (srfi srfi-1) remove)
>> + string-null?
>> + (string-split result #\newline)))))
>
> Why are you using @@ here? 'open-input-pipe', 'read-delimited' and 'remove'
> are exported variables, so you can just use @ instead of the magic evil @@
> operator.
Addressed the issue with the following patch.
[0001-toberebased-home-services-Use-instead-of.patch (text/x-patch, inline)]
From 27998096bf5b4ccd1c66ef71c1280faf0e11be72 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Mon, 5 Jul 2021 19:22:40 +0300
Subject: [PATCH] (toberebased) home-services: Use @ instead of @@
---
gnu/home-services.scm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gnu/home-services.scm b/gnu/home-services.scm
index a06cd72459..78e5603edf 100644
--- a/gnu/home-services.scm
+++ b/gnu/home-services.scm
@@ -280,15 +280,15 @@ extended with one gexp.")))
(readlink he-path)
#f))))
(if (file-exists? (he-init-file new-home))
- (let* ((port ((@@ (ice-9 popen) open-input-pipe)
+ (let* ((port ((@ (ice-9 popen) open-input-pipe)
(format #f "source ~a && env"
(he-init-file new-home))))
- (result ((@@ (ice-9 rdelim) read-delimited) "" port))
+ (result ((@ (ice-9 rdelim) read-delimited) "" port))
(vars (map (lambda (x)
(let ((si (string-index x #\=)))
(cons (string-take x si)
(string-drop x (1+ si)))))
- ((@@ (srfi srfi-1) remove)
+ ((@ (srfi srfi-1) remove)
string-null?
(string-split result #\newline)))))
(close-port port)
@@ -340,7 +340,7 @@ with one gexp, but many times, and all gexps must be idempotent.")))
(define (equal-regulars? file1 file2)
"Check if FILE1 and FILE2 are bit for bit identical."
(let* ((cmp-binary #$(file-append
- (@@ (gnu packages base) diffutils) "/bin/cmp"))
+ (@ (gnu packages base) diffutils) "/bin/cmp"))
(status (system* cmp-binary file1 file2)))
(= status 0)))
--
2.32.0
[Message part 3 (text/plain, inline)]
I can use different methods to attach/prepare/send patches and reply to
the reviews, sorry for any inconveniences in advance) I'll stick to some
approach, once I'll practice a few of them.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 270 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.