unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: Maxime Devos <maximedevos@telenet.be>, 48120@debbugs.gnu.org
Subject: [bug#48120] [PATCH] Teach etc/committer.scm.in some stuff
Date: Sun, 09 May 2021 20:34:19 +0200	[thread overview]
Message-ID: <87v97rhi38.fsf@yoctocell.xyz> (raw)
In-Reply-To: <039cd7066fe774cb6c3faad5e745da158d865485.camel@telenet.be>

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	other threads:[~2021-05-09 18:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 14:36 [bug#48120] [PATCH]: Teach etc/committer.scm.in some stuff Maxime Devos
2021-05-06  7:50 ` [bug#48120] [PATCH] " Maxime Devos
2021-05-09 18:34   ` Xinglu Chen [this message]
2022-05-22  3:33   ` [bug#48120] [PATCH]: " Maxim Cournoyer
2022-05-22  9:04     ` Maxime Devos
2022-05-22 13:13       ` Maxim Cournoyer
2021-06-17 13:36 ` [bug#48120] [PATCH] etc: committer: Read #~, #$ and #+ correctly Maxime Devos
2021-08-07 12:06 ` [bug#48120] [PATCH]: Teach etc/committer.scm.in some stuff Ricardo Wurmus
2021-11-22 23:07 ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v97rhi38.fsf@yoctocell.xyz \
    --to=public@yoctocell.xyz \
    --cc=48120@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).