* bug#36242: Repacked source checkouts get a misleading file name
@ 2019-06-16 9:04 Marius Bakke
2019-06-16 9:13 ` Efraim Flashner
2019-06-17 9:40 ` Ludovic Courtès
0 siblings, 2 replies; 4+ messages in thread
From: Marius Bakke @ 2019-06-16 9:04 UTC (permalink / raw)
To: 36242
[-- Attachment #1.1: Type: text/plain, Size: 315 bytes --]
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:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-packages-Keep-full-version-in-file-name-when-repacki.patch --]
[-- Type: text/x-patch, Size: 1611 bytes --]
From 0c44561d0d45de91f4674d659b86d740642ae801 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#36242: Repacked source checkouts get a misleading file name
2019-06-16 9:04 bug#36242: Repacked source checkouts get a misleading file name Marius Bakke
@ 2019-06-16 9:13 ` Efraim Flashner
2019-06-16 9:24 ` Marius Bakke
2019-06-17 9:40 ` Ludovic Courtès
1 sibling, 1 reply; 4+ messages in thread
From: Efraim Flashner @ 2019-06-16 9:13 UTC (permalink / raw)
To: Marius Bakke; +Cc: 36242
[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]
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 <mbakke@fastmail.com>
> 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
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#36242: Repacked source checkouts get a misleading file name
2019-06-16 9:13 ` Efraim Flashner
@ 2019-06-16 9:24 ` Marius Bakke
0 siblings, 0 replies; 4+ messages in thread
From: Marius Bakke @ 2019-06-16 9:24 UTC (permalink / raw)
To: Efraim Flashner; +Cc: 36242-done
[-- Attachment #1: Type: text/plain, Size: 2362 bytes --]
Efraim Flashner <efraim@flashner.co.il> 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 <mbakke@fastmail.com>
>> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#36242: Repacked source checkouts get a misleading file name
2019-06-16 9:04 bug#36242: Repacked source checkouts get a misleading file name Marius Bakke
2019-06-16 9:13 ` Efraim Flashner
@ 2019-06-17 9:40 ` Ludovic Courtès
1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2019-06-17 9:40 UTC (permalink / raw)
To: Marius Bakke; +Cc: 36242
Hello,
Marius Bakke <mbakke@fastmail.com> skribis:
> From 0c44561d0d45de91f4674d659b86d740642ae801 Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> 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.
LGTM! For ‘core-updates’, right?
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-17 9:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-16 9:04 bug#36242: Repacked source checkouts get a misleading file name Marius Bakke
2019-06-16 9:13 ` Efraim Flashner
2019-06-16 9:24 ` Marius Bakke
2019-06-17 9:40 ` Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).