guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#48120] [PATCH] Teach etc/committer.scm.in some stuff


From: Xinglu Chen
Subject: [bug#48120] [PATCH] Teach etc/committer.scm.in some stuff
Date: Sun, 09 May 2021 20:34:19 +0200

On Thu, May 06 2021, Maxime Devos wrote:

> New patch series, handling more edge cases.
>
> It needs some changes in how it wraps lines now there
> is a break-string procedure, but I don't have time to
> work on this currently so I'll just submit it as-is for now.

I don’t think I am qualified to review all of this, but it seems to work
after I made some minor fixes.  I just used ‘cc-for-target’ instead of
hardcoding ‘gcc’ on a random package, this is what I got.

--8<---------------cut here---------------start------------->8---
  gnu: eigensoft: Use the C cross-compiler.
  
  * gnu/packages/bioinformatics.scm (eigensoft)
  [arguments]<#:make-flags>: Use the C cross-compiler, instead of
  hardcoding "gcc".
--8<---------------cut here---------------end--------------->8---

> +(define (keyword-list->alist kwlist)
> +  (match kwlist
> +    (() '())
> +    (((? keyword? k) object . rest)
> +     `((,k . ,object) . ,(keyword-list->alist rest)))))
> +
> +(define (pairwise-foreach-keyword proc . arguments)
> +  "Apply PROC with each keyword argument and corresponding values
> +in ARGUMENTS.  If a value is not present in a argument, pass #f instead."
> +  (let* ((alists (map keyword-list->alist arguments))
> +         (keywords (delete-duplicates
> +                    (apply append (map (cut map car <>) alists))

‘append-map’ instead of (apply append (map ...) ...) ?

> +                    eq?)))
> +    (for-each (lambda (keyword)
> +                (apply proc keyword
> +                       (map (cut assoc-ref <> keyword) alists)))
> +              keywords)))
> +
>
> [...]
>
> @@ -207,6 +263,14 @@ corresponding to the top-level definition containing the 
> staged changes."
>        (() '())
>        ((first . rest)
>         (map cadadr first))))
> +  ;; Like get-values, but also allow quote and do not treat
> +  ;; the value of the field as an alist.
> +  (define (get-values/list expr field)
> +    (match ((sxpath `(// ,field ,(node-or (sxpath '(quasiquote))
> +                                          (sxpath '(quote))))) expr)
> +      (() '())
> +      ((first . rest)
> +       (second first))))
>    (define (listify items)
>      (match items
>        ((one) one)
> @@ -245,6 +309,34 @@ corresponding to the top-level definition containing the 
> staged changes."
>                                            (listify removed)
>                                            (listify added))))))))))
>              '(inputs propagated-inputs native-inputs)))

I think the parentheses are mismatched here, {M-x check-parens} should complain.

--8<---------------cut here---------------start------------->8---
~/src/guix $ guile etc/committer.scm.in
;;; note: source file /home/yoctocell/src/guix/etc/committer.scm
;;;       newer than compiled 
/home/yoctocell/.cache/guile/ccache/3.0-LE-8-4.4/home/yoctocell/src/guix/etc/committer.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/yoctocell/src/guix/etc/committer.scm
;;; WARNING: compilation of /home/yoctocell/src/guix/etc/committer.scm failed:
;;; In procedure read_inner_expression: etc/committer.scm:465:47: unexpected ")"
Backtrace:
           4 (primitive-load "/home/yoctocell/src/guix/etc/committer.scm")
In ice-9/eval.scm:
   298:34  3 (_ #<directory (guile-user) 7efdd29e9c80>)
   196:27  2 (_ #<directory (guile-user) 7efdd29e9c80>)
   223:20  1 (proc #<directory (guile-user) 7efdd29e9c80>)
In unknown file:
           0 (%resolve-variable (7 . get-values/no-unquote) #<directory 
(guile-user) 7efdd29e9c80>)

ERROR: In procedure %resolve-variable:
Unbound variable: get-values/no-unquote
--8<---------------cut here---------------end--------------->8---

> From 5f0313c01121a0a1e7f39f447425b5a8b70fb8c0 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Sat, 1 May 2021 12:19:05 +0200
> Subject: [PATCH 11/11] etc: committer: Handle substitute-keyword-arguments.
>
> * etc/committer.scm.in
>   (keyword-list->alist): Rename to ...
>   (keyword-list->alist/list): ..., and document the input format.
>  
> [...]
>
> -(define (keyword-list->alist kwlist)
> +;; Input: a list of keywords and the corresponding values,
> +;; without an exterior quote, quasiquote or list.
> +(define (keyword-list->alist/list kwlist)
>    (match kwlist
>      (() '())
>      (((? keyword? k) object . rest)
>       `((,k . ,object) . ,(keyword-list->alist rest)))
                             ^^^^^^^^^^^^^^^^^^^
‘keyword-list->alist/list’





reply via email to

[Prev in Thread] Current Thread [Next in Thread]