[PATCH] guix: svn: Allow dropping externals

DoneSubmitted by Julien Lepiller.
Details
2 participants
  • Julien Lepiller
  • Ludovic Courtès
Owner
unassigned
Severity
normal
J
J
Julien Lepiller wrote on 21 Oct 2019 21:55
(address . guix-patches@gnu.org)
20191021215538.60675430@sybil.lepiller.eu
A subversion repository can contain externals, references to otherprojects that also use subversion. This is very similar to gitsubmodules. When checking out a repository, svn will automaticallycheck these external repositories too. However, if the externals arenot pinned to a specific revision, svn will fetch the latest sourcesfor the external, leading to non reproducibility of the sources' hash.
This patch adds a fetch-externals? field to svn-reference andsvn-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.
From 0ac412a3c912b2fe7ebd05d178120db50d47184e Mon Sep 17 00:00:00 2001From: Julien Lepiller <julien@lepiller.eu>Date: Mon, 21 Oct 2019 21:48:31 +0200Subject: [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): Addfetch-externals? field.--- guix/build/svn.scm | 4 ++++ guix/svn-download.scm | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-)
Toggle diff (95 lines)diff --git a/guix/build/svn.scm b/guix/build/svn.scmindex 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.scmindex 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
L
L
Ludovic Courtès wrote on 22 Oct 2019 18:10
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 37857@debbugs.gnu.org)
87d0eozros.fsf@gnu.org
Hi Julien,
Julien Lepiller <julien@lepiller.eu> skribis:
Toggle quote (9 lines)>>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 theparameter and the field ‘recursive?’ rather than ‘fetch-externals?’?
Toggle quote (11 lines)> (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 tocheck every package that uses ‘svn-fetch’ (notably all the TeX Livepackages.)
Thanks,Ludo’.
J
J
Julien Lepiller wrote on 23 Oct 2019 23:34
(address . 37857-done@debbugs.gnu.org)
20191023233423.5e7b1bdf@sybil.lepiller.eu
Pushed as 51395c84fdbf8daed6392951a973ad750cf3eefa.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 37857@debbugs.gnu.org