[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#42338] [PATCH 01/34] guix: import: Add composer importer.
From: |
Julien Lepiller |
Subject: |
[bug#42338] [PATCH 01/34] guix: import: Add composer importer. |
Date: |
Sat, 19 Sep 2020 01:20:55 +0200 |
Le Fri, 18 Sep 2020 10:31:39 +0200,
Ludovic Courtès <ludo@gnu.org> a écrit :
> Hi!
>
> Julien Lepiller <julien@lepiller.eu> skribis:
>
> > From 6d521ca9f066f82488abefd5d3630e38305c0fd1 Mon Sep 17 00:00:00
> > 2001 From: Julien Lepiller <julien@lepiller.eu>
> > Date: Tue, 29 Oct 2019 08:07:38 +0100
> > Subject: [PATCH 01/34] guix: import: Add composer importer.
> >
> > * guix/import/composer.scm: New file.
> > * guix/scripts/import/composer.scm: New file.
> > * guix/tests/composer.scm: New file.
> > * Makefile.am: Add them.
> > * guix/scripts/import.scm: Add composer importer.
> > * doc/guix.texi (Invoking guix import): Mention it.
>
> [...]
>
> > +@item composer
> > +@cindex COMPOSER
>
> s/COMPOSER/Composer/ ?
>
> > +Import metadat from the @uref{https://getcomposer.org/, Composer}
> > package
> ^
> metadata
>
> > +archive used by the PHP community.
>
> Could you add an example command line like we have for some of the
> other importers? (It’s also useful for us as a test against the
> actual servers…)
>
> > + (let ((package (json-fetch
> > + (string-append (%composer-base-url) "/p/" name
> > ".json"))))
> > + (if package
> > + (let* ((packages (assoc-ref package "packages"))
> > + (package (assoc-ref packages name))
> > + (versions (filter
> > + (lambda (version)
> > + (and (not (string-contains version
> > "dev"))
> > + (not (string-contains version
> > "beta"))))
> > + (map car package)))
>
> Like I wrote before, I recommend ‘define-json-mapping’. If you prefer
> you can make that change later on once you’ve pushed this first
> version, but I really think it’ll help maintainability.
>
> This should also help avoid (map car …), which is frowned upon in
> Guix. :-)
>
> > + (versions (map
> > + (lambda (version)
>
> Rather indent as: (map (lambda (version)
>
> Otherwise LGTM!
>
> Ludo’.
Thanks, here's a new version
0001-guix-import-Add-composer-importer.patch
Description: Text Data