all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#37857] [PATCH] guix: svn: Allow dropping externals
@ 2019-10-21 19:55 Julien Lepiller
  2019-10-22 16:10 ` Ludovic Courtès
  2019-10-23 21:34 ` bug#37857: " Julien Lepiller
  0 siblings, 2 replies; 3+ messages in thread
From: Julien Lepiller @ 2019-10-21 19:55 UTC (permalink / raw)
  To: 37857

[-- 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#37857] [PATCH] guix: svn: Allow dropping externals
  2019-10-21 19:55 [bug#37857] [PATCH] guix: svn: Allow dropping externals Julien Lepiller
@ 2019-10-22 16:10 ` Ludovic Courtès
  2019-10-23 21:34 ` bug#37857: " Julien Lepiller
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2019-10-22 16:10 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 37857

Hi Julien,

Julien Lepiller <julien@lepiller.eu> skribis:

>>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.

Nice.

For consistency with git-download.scm & co., what about calling the
parameter and the field ‘recursive?’ rather than ‘fetch-externals?’?

>  (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))

Do you know of packages that rely on externals?

It’d be great to eventually default to #f, but for that we’d need to
check every package that uses ‘svn-fetch’ (notably all the TeX Live
packages.)

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#37857: [PATCH] guix: svn: Allow dropping externals
  2019-10-21 19:55 [bug#37857] [PATCH] guix: svn: Allow dropping externals Julien Lepiller
  2019-10-22 16:10 ` Ludovic Courtès
@ 2019-10-23 21:34 ` Julien Lepiller
  1 sibling, 0 replies; 3+ messages in thread
From: Julien Lepiller @ 2019-10-23 21:34 UTC (permalink / raw)
  To: 37857-done

Pushed as 51395c84fdbf8daed6392951a973ad750cf3eefa.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-23 21:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-21 19:55 [bug#37857] [PATCH] guix: svn: Allow dropping externals Julien Lepiller
2019-10-22 16:10 ` Ludovic Courtès
2019-10-23 21:34 ` bug#37857: " Julien Lepiller

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.