[bug#34097] import: github: Do not update URI for packages using git-fetch.

Message ID cu7h8e8lxl6.fsf@systemreboot.net
State Accepted
Headers show
Series [bug#34097] import: github: Do not update URI for packages using git-fetch. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed

Commit Message

Arun Isaac Jan. 16, 2019, 10:13 a.m. UTC
During `guix refresh PACKAGE`, the source URI for packages using
git-fetch need not be updated. It can be returned unchanged, as it
is. The attached patch does that.

As a side issue, without this patch, git-fetch packages that do not have
a source URI ending in ".git" are not updated correctly using `guix
refresh PACKAGE`. See the package emacs-evil for an example.

Comments

Ludovic Courtès Jan. 16, 2019, 10:48 a.m. UTC | #1
Hi,

Arun Isaac <arunisaac@systemreboot.net> skribis:

> During `guix refresh PACKAGE`, the source URI for packages using
> git-fetch need not be updated. It can be returned unchanged, as it
> is. The attached patch does that.
>
> As a side issue, without this patch, git-fetch packages that do not have
> a source URI ending in ".git" are not updated correctly using `guix
> refresh PACKAGE`. See the package emacs-evil for an example.
>
> From f63bf518395a06dd0c947222e177a66e59c59e96 Mon Sep 17 00:00:00 2001
> From: Arun Isaac <arunisaac@systemreboot.net>
> Date: Wed, 16 Jan 2019 15:21:06 +0530
> Subject: [PATCH] import: github: Do not update URI for packages using
>  git-fetch.
>
> * guix/import/github.scm (updated-github-url): Return the unchanged source URI
> for packages using git-fetch.
> [updated-url]: Do not handle URIs which end with ".git".

LGTM, thanks!

Ludo’.
Eric Bavier Jan. 16, 2019, 2:32 p.m. UTC | #2
On Wed, 16 Jan 2019 11:48:00 +0100
Ludovic Courtès <ludo@gnu.org> wrote:

> Hi,
> 
> Arun Isaac <arunisaac@systemreboot.net> skribis:
> 
> > During `guix refresh PACKAGE`, the source URI for packages using
> > git-fetch need not be updated. It can be returned unchanged, as it
> > is. The attached patch does that.
> >
> > As a side issue, without this patch, git-fetch packages that do not have
> > a source URI ending in ".git" are not updated correctly using `guix
> > refresh PACKAGE`. See the package emacs-evil for an example.
> >
> > From f63bf518395a06dd0c947222e177a66e59c59e96 Mon Sep 17 00:00:00 2001
> > From: Arun Isaac <arunisaac@systemreboot.net>
> > Date: Wed, 16 Jan 2019 15:21:06 +0530
> > Subject: [PATCH] import: github: Do not update URI for packages using
> >  git-fetch.
> >
> > * guix/import/github.scm (updated-github-url): Return the unchanged source URI
> > for packages using git-fetch.
> > [updated-url]: Do not handle URIs which end with ".git".  
> 
> LGTM, thanks!

LGTM too.  I had considered something similar when I first patched the
updater for git-fetch, but hadn't found an example where it was needed
(e.g. "emacs-evil").  Thanks!

`~Eric
Arun Isaac Jan. 16, 2019, 4:21 p.m. UTC | #3
Pushed! Thank you both for the review.

Patch

From f63bf518395a06dd0c947222e177a66e59c59e96 Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Wed, 16 Jan 2019 15:21:06 +0530
Subject: [PATCH] import: github: Do not update URI for packages using
 git-fetch.

* guix/import/github.scm (updated-github-url): Return the unchanged source URI
for packages using git-fetch.
[updated-url]: Do not handle URIs which end with ".git".
---
 guix/import/github.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/import/github.scm b/guix/import/github.scm
index ad662e7b02..b287313d98 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -2,6 +2,7 @@ 
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2019 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,7 +55,6 @@  false if none is recognized"
                                       (github-user-slash-repository url)))
               (repo    (github-repository url)))
           (cond
-           ((string-suffix? ".git" url) url)
            ((string-suffix? (string-append "/tarball/v" version) url)
             (string-append prefix "/tarball/v" new-version))
            ((string-suffix? (string-append "/tarball/" version) url)
@@ -99,7 +99,7 @@  false if none is recognized"
              ((source-uri ...)
               (find updated-url source-uri))))
      ((eq? fetch-method download:git-fetch)
-      (updated-url (download:git-reference-url source-uri)))
+      (download:git-reference-url source-uri))
      (else #f))))
 
 (define (github-package? package)
-- 
2.19.2