emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#36242: closed (Repacked source checkouts get a mis


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#36242: closed (Repacked source checkouts get a misleading file name)
Date: Sun, 16 Jun 2019 09:25:02 +0000

Your message dated Sun, 16 Jun 2019 11:24:03 +0200
with message-id <address@hidden>
and subject line Re: bug#36242: Repacked source checkouts get a misleading file 
name
has caused the debbugs.gnu.org bug report #36242,
regarding Repacked source checkouts get a misleading file name
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
36242: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36242
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Repacked source checkouts get a misleading file name Date: Sun, 16 Jun 2019 11:04:26 +0200 User-agent: Notmuch/0.29 (https://notmuchmail.org) Emacs/26.2 (x86_64-pc-linux-gnu)
Hello,

When repacking a source checkout (e.g. by using git-fetch with a
snippet), the generated file name contains only the first two version
identifiers.

E.g. `guix build -S eudev` returns

/gnu/store/7lgsxmr0rk9f8fbq6k0kj1aqb7lnrlll-eudev-3.2.tar.xz

...even though it should be "3.2.8".

This patch fixes it:

From 0c44561d0d45de91f4674d659b86d740642ae801 Mon Sep 17 00:00:00 2001
From: Marius Bakke <address@hidden>
Date: Sun, 16 Jun 2019 10:50:15 +0200
Subject: [PATCH] packages: Keep full version in file name when repacking
 source checkouts.

* guix/packages.scm (patch-and-repack): If ORIGINAL-FILE-NAME is a source
checkout, drop the '-checkout' part so the version-detecting code works.
---
 guix/packages.scm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index c94a651f27..5b8969e079 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -505,11 +505,17 @@ specifies modules in scope when evaluating SNIPPET."
     (and=> (file-extension file-name)
            (cut string-every char-set:hex-digit <>)))
 
+  (define (checkout? directory)
+    ;; Return true if DIRECTORY is a checkout (git, svn, etc).
+    (string-suffix? "-checkout" directory))
+
   (define (tarxz-name file-name)
     ;; Return a '.tar.xz' file name based on FILE-NAME.
-    (let ((base (if (numeric-extension? file-name)
-                    original-file-name
-                    (file-sans-extension file-name))))
+    (let ((base (cond ((numeric-extension? file-name)
+                       original-file-name)
+                      ((checkout? file-name)
+                       (string-drop-right file-name 9))
+                      (else (file-sans-extension file-name)))))
       (string-append base
                      (if (equal? (file-extension base) "tar")
                          ".xz"
-- 
2.22.0

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message --- Subject: Re: bug#36242: Repacked source checkouts get a misleading file name Date: Sun, 16 Jun 2019 11:24:03 +0200 User-agent: Notmuch/0.29 (https://notmuchmail.org) Emacs/26.2 (x86_64-pc-linux-gnu)
Efraim Flashner <address@hidden> writes:

> On Sun, Jun 16, 2019 at 11:04:26AM +0200, Marius Bakke wrote:
>> Hello,
>> 
>> When repacking a source checkout (e.g. by using git-fetch with a
>> snippet), the generated file name contains only the first two version
>> identifiers.
>> 
>> E.g. `guix build -S eudev` returns
>> 
>> /gnu/store/7lgsxmr0rk9f8fbq6k0kj1aqb7lnrlll-eudev-3.2.tar.xz
>> 
>> ...even though it should be "3.2.8".
>> 
>> This patch fixes it:
>> 
>
>> From 0c44561d0d45de91f4674d659b86d740642ae801 Mon Sep 17 00:00:00 2001
>> From: Marius Bakke <address@hidden>
>> Date: Sun, 16 Jun 2019 10:50:15 +0200
>> Subject: [PATCH] packages: Keep full version in file name when repacking
>>  source checkouts.
>> 
>> * guix/packages.scm (patch-and-repack): If ORIGINAL-FILE-NAME is a source
>> checkout, drop the '-checkout' part so the version-detecting code works.
>> ---
>>  guix/packages.scm | 12 +++++++++---
>>  1 file changed, 9 insertions(+), 3 deletions(-)
>> 
>> diff --git a/guix/packages.scm b/guix/packages.scm
>> index c94a651f27..5b8969e079 100644
>> --- a/guix/packages.scm
>> +++ b/guix/packages.scm
>> @@ -505,11 +505,17 @@ specifies modules in scope when evaluating SNIPPET."
>>      (and=> (file-extension file-name)
>>             (cut string-every char-set:hex-digit <>)))
>>  
>> +  (define (checkout? directory)
>> +    ;; Return true if DIRECTORY is a checkout (git, svn, etc).
>> +    (string-suffix? "-checkout" directory))
>> +
>>    (define (tarxz-name file-name)
>>      ;; Return a '.tar.xz' file name based on FILE-NAME.
>> -    (let ((base (if (numeric-extension? file-name)
>> -                    original-file-name
>> -                    (file-sans-extension file-name))))
>> +    (let ((base (cond ((numeric-extension? file-name)
>> +                       original-file-name)
>> +                      ((checkout? file-name)
>> +                       (string-drop-right file-name 9))
>> +                      (else (file-sans-extension file-name)))))
>>        (string-append base
>>                       (if (equal? (file-extension base) "tar")
>>                           ".xz"
>> -- 
>> 2.22.0
>> 
>
> Pinging Mark and Ludo, similar to https://issues.guix.info/issue/34066

Whoops, was not aware of that report!  Closing as duplicate.

Attachment: signature.asc
Description: PGP signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]