From: "Ludovic Courtès" <ludo@gnu.org>
To: Nicolas Graves <ngraves@ngraves.fr>
Cc: 70227@debbugs.gnu.org
Subject: [bug#70227] [PATCH 2/2] guix: import: composer: Implement recursive package refresh.
Date: Mon, 29 Apr 2024 23:29:44 +0200 [thread overview]
Message-ID: <87wmofzwl3.fsf@gnu.org> (raw)
In-Reply-To: <20240406020852.15996-2-ngraves@ngraves.fr> (Nicolas Graves's message of "Sat, 6 Apr 2024 04:08:51 +0200")
Hi!
Nicolas Graves <ngraves@ngraves.fr> skribis:
> * guix/import/composer.scm
> (composer-fetch): Replace reduce by fold to correct version selection
> logic.
> (latest-release): Implement recursive package refresh. Rename to
> import-release.
> (import-release): New function, formerly known as latest-release.
Nice, glad to see this feature put to good use. :-)
[...]
> +(define* (import-release package #:key (version #f))
> + "Return an <upstream-source> for VERSION or the latest release of PACKAGE."
> (let* ((php-name (guix-package->composer-name package))
> (composer-package (composer-fetch php-name #:version version)))
> (if composer-package
> - (upstream-source
> - (package (composer-package-name composer-package))
> - (version (composer-package-version composer-package))
> - (urls (list (composer-source-url
> - (composer-package-source composer-package)))))
> + (let* ((guix-name (composer-package-name composer-package))
> + (inputs
> + (append
> + (map (lambda (dep)
> + (upstream-input
> + (name php-name)
> + (downstream-name guix-name)
> + (type 'regular)))
> + (composer-package-require composer-package))
> + (map (lambda (dep)
> + (upstream-input
> + (name php-name)
> + (downstream-name guix-name)
> + (type 'native)))
Shouldn’t it be:
(upstream-input
(name dep)
(downstream-name (php-package-name dep))
(type …))
?
As a slight improvement, since the ‘inputs’ field of <upstream-source>
is delayed (wrapped in a promise, so that its computation only happens
when it’s needed), you could arrange to replace the ‘inputs’ variable
above like so:
(define (dependency->input dependency type)
(upstream-input …))
(upstream-source
;; …
(inputs (append (map (cut dependency->input <> 'regular) …)
(map (cut dependency->input <> 'native) …))))
I hope this makes sense.
Thanks!
Ludo’.
prev parent reply other threads:[~2024-04-29 21:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-06 2:04 [bug#70227] [PATCH 0/2] Improving composer import Nicolas Graves via Guix-patches via
2024-04-06 2:08 ` [bug#70227] [PATCH 1/2] guix: import: composer: Handle parsing failures Nicolas Graves via Guix-patches via
2024-04-06 2:08 ` [bug#70227] [PATCH 2/2] guix: import: composer: Implement recursive package refresh Nicolas Graves via Guix-patches via
2024-04-29 21:29 ` Ludovic Courtès [this message]
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=87wmofzwl3.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=70227@debbugs.gnu.org \
--cc=ngraves@ngraves.fr \
/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).