From e584a093f943be216fdc93895281fde835836b8d Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Sat, 19 Mar 2022 22:39:33 +0000 Subject: packages: Fix time-travel from Guix 1.1.0 / Guile < 2.2.7. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/packages.scm: Only set #:replace? #true when Guile is >= 2.2.7. Fixes: Reported-By: Peter Kois Signed-off-by: Ludovic Courtès --- 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 ;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; Copyright © 2021 Chris Marusich +;;; Copyright © 2022 Maxime Devos ;;; ;;; 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: . -;; 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 . +(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: ;;; -- cgit 1.4.1