diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-12-20 16:34:22 -0500 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-12-20 21:19:26 -0500 |
commit | d368210af5760d81fcb9964d3cd88c590c36407f (patch) | |
tree | 5c114da344e0bfc4376ebf67f5f892a1e960df32 | |
parent | 4a4f2d226e6fbbb303bc03b77fc4031f3db8e058 (diff) |
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).
-rw-r--r-- | guix/build/kconfig.scm | 20 |
1 files 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 |