[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#47754] [PATCH] gnu: transformations: fix with-latest option for git
From: |
Z572 |
Subject: |
[bug#47754] [PATCH] gnu: transformations: fix with-latest option for git source package. |
Date: |
Wed, 03 Nov 2021 22:54:40 +0800 |
User-agent: |
mu4e 1.6.9; emacs 28.0.50 |
Hi,
zimoun <zimon.toutoune@gmail.com> writes:
> Hi,
>
> Thanks for the patch.
>
> On Wed, 14 Apr 2021 at 00:28, Z572 <873216071@qq.com> wrote:
>
>>>From 52bd30a6ac967375aa9a178345f1bdea8388457a Mon Sep 17 00:00:00 2001
>> From: Zheng Junjie <873216071@qq.com>
>> Date: Tue, 13 Apr 2021 23:00:10 +0800
>> Subject: [PATCH] gnu: transformations: fix with-latest option for git source
>> package.
>>
>> gnu/transformations.scm: (transform-package-latest):
>> (package-with-latest-upstream):
>> use git-checkout if p is a git source package.
>> ---
>> guix/transformations.scm | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> [...]
>
>> #:autoload (guix upstream) (package-latest-release*
>> + upstream-source-urls
>> upstream-source-version
>> upstream-source-signature-urls)
>> #:use-module (guix utils)
>> @@ -537,7 +539,11 @@ are replaced by their latest upstream version."
>> (package
>> (inherit p)
>> (version (upstream-source-version source))
>> - (source source))))))
>> + (source (cond ((false-if-exception (package-git-url p))
>> + (git-checkout
>> + (url (car (upstream-source-urls source)))
>> + (recursive? #t)))
>> + (else source))))))))
>
> Could you provide an example for an use-case?
Just try this:
``` bash
$ file `guix build fbreader --with-latest=fbreader -S`
/gnu/store/rdqkmjpiig9gddzsxj4mdyw8lvn944xg-FBReader: HTML document, UTF-8
Unicode text, with very long lines
```
If a package is a git source package, after use "with-latest" option, it's url
will become to it's source. and build will fail.
This patch just fix this.
But i think this patch not good, maybe need a new patch(use latest version
not latest commit). But i'm not familiar with this part.
>
> Cheers,
> simon
--
over