guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/08: time-machine: Handle 'git-error' exceptions.


From: guix-commits
Subject: 07/08: time-machine: Handle 'git-error' exceptions.
Date: Fri, 15 Nov 2019 17:29:40 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit d17e012da7b41165cb49a5604a773459736144e3
Author: Ludovic Courtès <address@hidden>
Date:   Fri Nov 15 21:11:58 2019 +0100

    time-machine: Handle 'git-error' exceptions.
    
    * guix/scripts/pull.scm (with-git-error-handling): Export.
    * guix/scripts/time-machine.scm (guix-time-machine): Wrap body in
    'with-git-error-handling'.
---
 guix/scripts/pull.scm         |  1 +
 guix/scripts/time-machine.scm | 20 +++++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index c42794d..0ab688a 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -57,6 +57,7 @@
   #:use-module (ice-9 format)
   #:export (display-profile-content
             channel-list
+            with-git-error-handling
             guix-pull))
 
 
diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm
index a64badc..946b523 100644
--- a/guix/scripts/time-machine.scm
+++ b/guix/scripts/time-machine.scm
@@ -22,7 +22,8 @@
   #:use-module (guix inferior)
   #:use-module (guix channels)
   #:use-module (guix store)
-  #:use-module ((guix scripts pull) #:select (channel-list))
+  #:use-module ((guix scripts pull)
+                #:select (with-git-error-handling channel-list))
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
@@ -94,11 +95,12 @@ Execute COMMAND ARGS... in an older version of Guix.\n"))
 
 (define (guix-time-machine . args)
   (with-error-handling
-    (let* ((opts         (parse-args args))
-           (channels     (channel-list opts))
-           (command-line (assoc-ref opts 'exec)))
-      (when command-line
-        (let* ((directory  (with-store store
-                             (cached-channel-instance store channels)))
-               (executable (string-append directory "/bin/guix")))
-          (apply execl (cons* executable executable command-line)))))))
+    (with-git-error-handling
+     (let* ((opts         (parse-args args))
+            (channels     (channel-list opts))
+            (command-line (assoc-ref opts 'exec)))
+       (when command-line
+         (let* ((directory  (with-store store
+                              (cached-channel-instance store channels)))
+                (executable (string-append directory "/bin/guix")))
+           (apply execl (cons* executable executable command-line))))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]