GNU bug report logs - #47754
[PATCH] gnu: transformations: fix with-latest option for git source package.

Previous Next

Package: guix-patches;

Reported by: Z572 <873216071 <at> qq.com>

Date: Tue, 13 Apr 2021 16:33:01 UTC

Severity: normal

Tags: patch

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Z572 <873216071 <at> qq.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: transformations: fix with-latest option for git source
 package.
Date: Wed, 14 Apr 2021 00:28:57 +0800
[0001-gnu-transformations-fix-with-latest-option-for-git-s.patch (text/x-patch, inline)]
From 52bd30a6ac967375aa9a178345f1bdea8388457a Mon Sep 17 00:00:00 2001
From: Zheng Junjie <873216071 <at> 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(-)

diff --git a/guix/transformations.scm b/guix/transformations.scm
index 4e9260350c..559e408c37 100644
--- a/guix/transformations.scm
+++ b/guix/transformations.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright @ 2021 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,6 +27,7 @@
   #:autoload   (guix git-download) (git-reference? git-reference-url)
   #:autoload   (guix git) (git-checkout git-checkout? git-checkout-url)
   #: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))))))))
 
   (define rewrite
     (package-input-rewriting/spec
-- 
2.31.1





This bug report was last modified 3 years and 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.