[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/06: kconfig: Move pair->config-string up.
From: |
guix-commits |
Subject: |
02/06: kconfig: Move pair->config-string up. |
Date: |
Tue, 20 Dec 2022 21:32:37 -0500 (EST) |
apteryx pushed a commit to branch master
in repository guix.
commit d368210af5760d81fcb9964d3cd88c590c36407f
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Tue Dec 20 16:34:22 2022 -0500
kconfig: Move pair->config-string up.
* guix/build/kconfig.scm (pair->config-string): Move earlier, to match the
natural dependency of declarations (useful when experimenting at the REPL).
---
guix/build/kconfig.scm | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/guix/build/kconfig.scm b/guix/build/kconfig.scm
index d0189f558f..192bc17c21 100644
--- a/guix/build/kconfig.scm
+++ b/guix/build/kconfig.scm
@@ -31,6 +31,16 @@
;;
;; Code:
+(define (pair->config-string pair)
+ "Convert a PAIR back to a config-string."
+ (let* ((key (first pair))
+ (value (cdr pair)))
+ (if (string? key)
+ (if (string? value)
+ (string-append key "=" value)
+ (string-append "# " key " is not set"))
+ value)))
+
(define (config-string->pair config-string)
"Parse a configuration string like \"CONFIG_EXAMPLE=m\" into a key-value
pair.
An error is thrown for invalid configurations.
@@ -77,16 +87,6 @@ An error is thrown for invalid configurations.
(cons #f config-string) ;keep valid comments
(error "Invalid configuration" config-string)))))
-(define (pair->config-string pair)
- "Convert a PAIR back to a config-string."
- (let* ((key (first pair))
- (value (cdr pair)))
- (if (string? key)
- (if (string? value)
- (string-append key "=" value)
- (string-append "# " key " is not set"))
- value)))
-
(define (defconfig->alist defconfig)
"Convert the content of a DEFCONFIG (or .config) file into an alist."
(with-input-from-file defconfig
- branch master updated (b0943d3d2e -> c04528d2a2), guix-commits, 2022/12/20
- 02/06: kconfig: Move pair->config-string up.,
guix-commits <=
- 01/06: gnu: u-boot-tools: Delete trailing #t., guix-commits, 2022/12/20
- 05/06: gnu: u-boot: Add pkg-config to native inputs., guix-commits, 2022/12/20
- 03/06: kconfig: Mostly preserve keys ordering of original defconfig., guix-commits, 2022/12/20
- 04/06: kconfig: Streamline comment in 'modify-defconfig'., guix-commits, 2022/12/20
- 06/06: gnu: u-boot-am335x-evm-boneblack: Fix variable name., guix-commits, 2022/12/20