diff mbox series

[bug#50358,core-updates-frozen,1/8] guix: packages: Fix repacking of plain tarballs.

Message ID 20210903153116.22517-1-maxim.cournoyer@gmail.com
State Accepted
Headers show
Series Shortened Rust bootstrap & other fixes. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Maxim Cournoyer Sept. 3, 2021, 3:31 p.m. UTC
Fixes <https://issues.guix.gnu.org/50066>.

* guix/packages.scm (patch-and-repack): Test for a tarball using tarball? and
move the plain file copy to the else clause.

Reported-by: Mathieu Othacehe <othacehe@gnu.org>
---
 guix/packages.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Mathieu Othacehe Sept. 3, 2021, 6:47 p.m. UTC | #1
Hello Maxim,

> * guix/packages.scm (patch-and-repack): Test for a tarball using tarball? and
> move the plain file copy to the else clause.

I could not test it locally, but it looks fine to me.

Thanks for fixing it,

Mathieu
Ludovic Courtès Sept. 8, 2021, 4:27 p.m. UTC | #2
Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> Fixes <https://issues.guix.gnu.org/50066>.
>
> * guix/packages.scm (patch-and-repack): Test for a tarball using tarball? and
> move the plain file copy to the else clause.
>
> Reported-by: Mathieu Othacehe <othacehe@gnu.org>

[...]

> +               ((or #+comp (tarball? #+source))
> +                (repack directory #$output))

Would (tarball? #+source) be enough?

Otherwise LGTM!  (Too bad I had overlooked this patch, it would have
been nice to be done with world rebuilds.)

Thanks,
Ludo’.
Maxim Cournoyer Sept. 12, 2021, 2:49 a.m. UTC | #3
Hello!

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> Fixes <https://issues.guix.gnu.org/50066>.
>>
>> * guix/packages.scm (patch-and-repack): Test for a tarball using tarball? and
>> move the plain file copy to the else clause.
>>
>> Reported-by: Mathieu Othacehe <othacehe@gnu.org>
>
> [...]
>
>> +               ((or #+comp (tarball? #+source))
>> +                (repack directory #$output))
>
> Would (tarball? #+source) be enough?

No!  Because any (non-tarball) compressed archives (of the types handled
by compressor in (guix build utils) must also be repacked) :-).

> Otherwise LGTM!  (Too bad I had overlooked this patch, it would have
> been nice to be done with world rebuilds.)

Yeah.  I'm attempting to synchronize for the next rebuild.

Thanks!

Maxim
diff mbox series

Patch

diff --git a/guix/packages.scm b/guix/packages.scm
index 2349bb4340..f0dd1d43d2 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -836,10 +836,10 @@  specifies modules in scope when evaluating SNIPPET."
                ((file-is-directory? #+source)
                 (copy-recursively directory #$output
                                   #:log (%make-void-port "w")))
-               ((not #+comp)
-                (copy-file file #$output))
-               (else
-                (repack directory #$output)))))))
+               ((or #+comp (tarball? #+source))
+                (repack directory #$output))
+               (else                    ;single uncompressed file
+                (copy-file file #$output)))))))
 
     (let ((name (if (or (checkout? original-file-name)
                         (not (compressor original-file-name)))