diff mbox series

[bug#37401,2/2] pack: Add packages in the order in which they appear on the command line.

Message ID 20190913155116.19225-2-ludo@gnu.org
State Accepted
Headers show
Series 'guix pack -f docker' uses a meaningful "repository name" | expand

Commit Message

Ludovic Courtès Sept. 13, 2019, 3:51 p.m. UTC
* guix/scripts/pack.scm (guix-pack)[manifest-from-args](packages):
Reverse order of packages taken fro OPTS.
---
 guix/scripts/pack.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ricardo Wurmus Sept. 13, 2019, 4:16 p.m. UTC | #1
Ludovic Courtès <ludo@gnu.org> writes:

> * guix/scripts/pack.scm (guix-pack)[manifest-from-args](packages):
> Reverse order of packages taken fro OPTS.

Typo: “from”.

> -                               (filter-map maybe-package-argument opts)))
> +                               (reverse
> +                                (filter-map maybe-package-argument opts))))

Why is this necessary?
Ludovic Courtès Sept. 14, 2019, 9:42 a.m. UTC | #2
Ricardo Wurmus <rekado@elephly.net> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> * guix/scripts/pack.scm (guix-pack)[manifest-from-args](packages):
>> Reverse order of packages taken fro OPTS.
>
> Typo: “from”.
>
>> -                               (filter-map maybe-package-argument opts)))
>> +                               (reverse
>> +                                (filter-map maybe-package-argument opts))))
>
> Why is this necessary?

It’s mostly so that if you do ‘guix pack -f docker sed grep findutils’
the repo name is “sed-grep-findutils” and not “findutils-grep-sed”.

Ludo’.
Simon Tournier Sept. 18, 2019, 4:27 p.m. UTC | #3
Hi,

That really nice!
Thank you.

On Sat, 14 Sep 2019 at 11:43, Ludovic Courtès <ludo@gnu.org> wrote:

> It’s mostly so that if you do ‘guix pack -f docker sed grep findutils’
> the repo name is “sed-grep-findutils” and not “findutils-grep-sed”.

It is not in the doc, right?
If I want to create a "profile" with a meaningful name, then the order
after '-f' becomes important. Maybe one line explaining, something
like:

(current doc)
The result is a tarball that can be passed to the ‘docker load’ command.
See the Docker documentation
(https://docs.docker.com/engine/reference/commandline/load/) for more
information.
(addition)
Note that the profile name is built using the package names.


Well, and what happens if there is 10 or more packages? Is the name trimmed?


All the best,
simon
Ludovic Courtès Sept. 18, 2019, 8:48 p.m. UTC | #4
Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> On Sat, 14 Sep 2019 at 11:43, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> It’s mostly so that if you do ‘guix pack -f docker sed grep findutils’
>> the repo name is “sed-grep-findutils” and not “findutils-grep-sed”.
>
> It is not in the doc, right?
> If I want to create a "profile" with a meaningful name, then the order
> after '-f' becomes important. Maybe one line explaining, something
> like:
>
> (current doc)
> The result is a tarball that can be passed to the ‘docker load’ command.
> See the Docker documentation
> (https://docs.docker.com/engine/reference/commandline/load/) for more
> information.
> (addition)
> Note that the profile name is built using the package names.

Good idea, I’ve committed something along these lines.

> Well, and what happens if there is 10 or more packages? Is the name trimmed?

Yes, it’s trimmed (there are apparently no hard limits but the output of
“docker images” becomes hard to read if the first column is too wide.)

Ludo’.
diff mbox series

Patch

diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index ed8c177055..2543f0c0b5 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -957,7 +957,8 @@  Create a bundle of PACKAGE.\n"))
                                   (list (transform store package) output))
                                  ((? package? package)
                                   (list (transform store package) "out")))
-                               (filter-map maybe-package-argument opts)))
+                               (reverse
+                                (filter-map maybe-package-argument opts))))
            (manifest-file (assoc-ref opts 'manifest)))
       (define properties
         (if (assoc-ref opts 'save-provenance?)