all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: 37857@debbugs.gnu.org
Subject: [bug#37857] [PATCH] guix: svn: Allow dropping externals
Date: Mon, 21 Oct 2019 21:55:38 +0200	[thread overview]
Message-ID: <20191021215538.60675430@sybil.lepiller.eu> (raw)

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

A subversion repository can contain externals, references to other
projects that also use subversion. This is very similar to git
submodules. When checking out a repository, svn will automatically
check these external repositories too. However, if the externals are
not pinned to a specific revision, svn will fetch the latest sources
for the external, leading to non reproducibility of the sources' hash.

This patch adds a fetch-externals? field to svn-reference and
svn-multi-reference, defaulting to #t for preserving the old behavior.
Setting it to #f will prevent fetching any external from the project.
This is useful for josm for instance.

[-- Attachment #2: 0001-guix-svn-Allow-dropping-externals.patch --]
[-- Type: text/x-patch, Size: 4864 bytes --]

From 0ac412a3c912b2fe7ebd05d178120db50d47184e Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 21 Oct 2019 21:48:31 +0200
Subject: [PATCH] guix: svn: Allow dropping externals.

* guix/build/svn.scm (svn-fetch): Allow to ignore externals.
* guix/svn-download.scm (svn-reference, svn-multi-reference): Add
fetch-externals? field.
---
 guix/build/svn.scm    |  4 ++++
 guix/svn-download.scm | 25 ++++++++++++++++---------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/guix/build/svn.scm b/guix/build/svn.scm
index e3188add3e..ff3ca3a666 100644
--- a/guix/build/svn.scm
+++ b/guix/build/svn.scm
@@ -31,6 +31,7 @@
 
 (define* (svn-fetch url revision directory
                     #:key (svn-command "svn")
+                    (fetch-externals? #t)
                     (user-name #f)
                     (password #f))
   "Fetch REVISION from URL into DIRECTORY.  REVISION must be an integer, and a
@@ -45,6 +46,9 @@ valid Subversion revision.  Return #t on success, #f otherwise."
                  (list (string-append "--username=" user-name)
                        (string-append "--password=" password))
                  '())
+           ,@(if fetch-externals?
+                 '()
+                 (list "--ignore-externals"))
            ,url ,directory))
   #t)
 
diff --git a/guix/svn-download.scm b/guix/svn-download.scm
index 4139cbc2e2..16da2102d6 100644
--- a/guix/svn-download.scm
+++ b/guix/svn-download.scm
@@ -31,6 +31,7 @@
             svn-reference?
             svn-reference-url
             svn-reference-revision
+            svn-reference-fetch-externals?
             svn-fetch
             download-svn-to-store
 
@@ -39,6 +40,7 @@
             svn-multi-reference-url
             svn-multi-reference-revision
             svn-multi-reference-locations
+            svn-multi-reference-fetch-externals?
             svn-multi-fetch))
 
 ;;; Commentary:
@@ -52,10 +54,11 @@
 (define-record-type* <svn-reference>
   svn-reference make-svn-reference
   svn-reference?
-  (url       svn-reference-url)                    ; string
-  (revision  svn-reference-revision)               ; number
-  (user-name svn-reference-user-name (default #f))
-  (password  svn-reference-password (default #f)))
+  (url              svn-reference-url)                    ; string
+  (revision         svn-reference-revision)               ; number
+  (fetch-externals? svn-reference-fetch-externals? (default #t))
+  (user-name        svn-reference-user-name (default #f))
+  (password         svn-reference-password (default #f)))
 
 (define (subversion-package)
   "Return the default Subversion package."
@@ -78,6 +81,7 @@ HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
                      '#$(svn-reference-revision ref)
                      #$output
                      #:svn-command (string-append #+svn "/bin/svn")
+                     #:fetch-externals? #$(svn-reference-fetch-externals? ref)
                      #:user-name #$(svn-reference-user-name ref)
                      #:password #$(svn-reference-password ref)))))
 
@@ -93,11 +97,12 @@ HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
 (define-record-type* <svn-multi-reference>
   svn-multi-reference make-svn-multi-reference
   svn-multi-reference?
-  (url        svn-multi-reference-url)                 ; string
-  (revision   svn-multi-reference-revision)            ; number
-  (locations  svn-multi-reference-locations)           ; list of strings
-  (user-name  svn-multi-reference-user-name (default #f))
-  (password   svn-multi-reference-password (default #f)))
+  (url              svn-multi-reference-url)                 ; string
+  (revision         svn-multi-reference-revision)            ; number
+  (locations        svn-multi-reference-locations)           ; list of strings
+  (fetch-externals? svn-multi-reference-fetch-externals? (default #t))
+  (user-name        svn-multi-reference-user-name (default #f))
+  (password         svn-multi-reference-password (default #f)))
 
 (define* (svn-multi-fetch ref hash-algo hash
                           #:optional name
@@ -125,6 +130,8 @@ HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
                                   (string-append #$output "/" location)
                                   (string-append #$output "/" (dirname location)))
                               #:svn-command (string-append #+svn "/bin/svn")
+                              #:fetch-externals?
+                              #$(svn-reference-fetch-externals? ref)
                               #:user-name #$(svn-multi-reference-user-name ref)
                               #:password #$(svn-multi-reference-password ref)))
                  '#$(svn-multi-reference-locations ref)))))
-- 
2.22.0


             reply	other threads:[~2019-10-21 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 19:55 Julien Lepiller [this message]
2019-10-22 16:10 ` [bug#37857] [PATCH] guix: svn: Allow dropping externals Ludovic Courtès
2019-10-23 21:34 ` bug#37857: " Julien Lepiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191021215538.60675430@sybil.lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=37857@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.