summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-04-07 23:31:41 +0200
committerLudovic Courtès <ludo@gnu.org>2020-04-08 00:05:45 +0200
commit93add9bf7d73b6a6ed2d0cf85778b26aa38fd194 (patch)
tree047402f851bd0c440b7f2112a8d92745790d0dd7
parent1c86577d624b97a03138640b4d849823b504570e (diff)
downloadpatches-93add9bf7d73b6a6ed2d0cf85778b26aa38fd194.tar
patches-93add9bf7d73b6a6ed2d0cf85778b26aa38fd194.tar.gz
reconfigure: Correctly re-throw SRFI-34 exceptions on Guile 3.
Previously, we'd just print an ugly backtrace when running on Guile 3 because the '%exception throw would not be caught anywhere. Reported by Arne Babenhauserheide <arne_bab@web.de> in <https://bugs.gnu.org/40496>. * guix/scripts/system/reconfigure.scm (install-bootloader-program): In 'catch' handler, match '%exception and use 'raise-exception' instead of 'throw' to rethrow in that case.
-rw-r--r--guix/scripts/system/reconfigure.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm
index 074c48f58b..7885c33457 100644
--- a/guix/scripts/system/reconfigure.scm
+++ b/guix/scripts/system/reconfigure.scm
@@ -211,6 +211,7 @@ BOOTLOADER-PACKAGE."
(guix store)
(guix utils)
(ice-9 binary-ports)
+ (ice-9 match)
(srfi srfi-34)
(srfi srfi-35))
@@ -235,7 +236,11 @@ BOOTLOADER-PACKAGE."
(#$installer #$bootloader-package #$device #$target))
(lambda args
(delete-file new-gc-root)
- (apply throw args))))
+ (match args
+ (('%exception exception) ;Guile 3 SRFI-34 or similar
+ (raise-exception exception))
+ ((key . args)
+ (apply throw key args))))))
;; We are sure that the installation of the bootloader
;; succeeded, so we can replace the old GC root by the new
;; GC root now.