[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/04: packages: Fix time-travel from Guix 1.1.0 / Guile < 2.2.7.
From: |
guix-commits |
Subject: |
04/04: packages: Fix time-travel from Guix 1.1.0 / Guile < 2.2.7. |
Date: |
Mon, 21 Mar 2022 18:04:44 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit e584a093f943be216fdc93895281fde835836b8d
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Mar 19 22:39:33 2022 +0000
packages: Fix time-travel from Guix 1.1.0 / Guile < 2.2.7.
* guix/packages.scm: Only set #:replace? #true when Guile is >= 2.2.7.
Fixes: <https://issues.guix.gnu.org/53765>
Reported-By: Peter Kois <kangus@gmail.com>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
guix/packages.scm | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/guix/packages.scm b/guix/packages.scm
index 288ae37523..1c63eb2d3e 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
+;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -182,8 +183,16 @@
;; The 'source-module-closure' procedure ca. 1.2.0 did not recognize
;; #:re-export-and-replace: <https://issues.guix.gnu.org/52694>.
-;; Work around it.
-(module-re-export! (current-module) '(delete) #:replace? #t)
+;; Work around it. The #:replace? argument is only supported by
+;; Guile 2.2.7 and later, work-around it if necessary to allow
+;; time-travel from 1.1.0, see <https://issues.guix.gnu.org/53765>.
+(let ((major (string->number (major-version))))
+ (if (or (>= major 3)
+ (and (= major 2)
+ (= (string->number (minor-version)) 2) ; there is no Guile 2.3.X
+ (>= (string->number (micro-version)) 7)))
+ (module-re-export! (current-module) '(delete) #:replace? #t)
+ (module-re-export! (current-module) '(delete))))
;;; Commentary:
;;;