Subject: Re: bug#26652: [PATCH 2/2] scripts: refresh: Add -m manifest option.

From: [email-masked] (Ludovic Courtès)
Date: Wed, 03 May 2017 22:04:24 +0200

Mathieu Othacehe <[email-masked]> skribis:

> * guix/scripts/refresh.scm (%options): Add -m option,
> (show-help): document it,
> (get-manifest-packages): new procedure,
> (guix-refresh): use packages from manifest if specified, otherwise
> keep the previous behaviour.

This sounds useful!

>    (display (_ "
> +  -m, --manifest=FILE    select all the packages in FILE manifest"))

“select all the package from the manifest in FILE” maybe?

> +(define (get-manifest-packages manifest)
> +  "Return the list of packages in loaded MANIFEST."
> +  (let* ((user-module (make-user-module '((guix profiles) (gnu))))
> +         (manifest    (load* manifest user-module)))
> +    (manifest->packages manifest)))

With ‘manifest->packages’ moved in this module, that would be fine.

Also, maybe s/get-manifest-packages/packages-from-manifest/, because
‘get-’ is quite unusual.  :-)

> +         (packages
> +          (or manifest-packages args-packages)))

Maybe (append (match (assoc-ref opts 'manifest)
                (#f '())
                ((? string? file) (packages-from-manifest file)))
              args-packages)

?

Could you also update guix.texi to mention this option and the intended
use case?

Thank you!

Ludo’.