@@ -35,6 +35,7 @@ (define-module (guix git)
#:use-module (guix gexp)
#:use-module (guix sets)
#:use-module ((guix diagnostics) #:select (leave warning))
+ #:use-module (guix ui)
#:use-module (guix progress)
#:autoload (guix swh) (swh-download commit-id?)
#:use-module (rnrs bytevectors)
@@ -200,8 +201,16 @@ (define (clone* url directory)
(clone url directory
(make-clone-options
#:fetch-options (make-default-fetch-options))))
- (lambda _
- (false-if-exception (rmdir directory)))))
+ (lambda args
+ (false-if-exception (rmdir directory))
+ ;; Compensate for unixy errors, e.g., ‘error: mkdir: Permission denied’.
+ ;; XXX This displays the hint before the error. After would be nicer.
+ ;; XXX So would a generic mechanism for dealing with such errors.
+ (match args
+ ((system-error _ _ _ EPERM)
+ (display-hint (format #f (G_ "can you create and write to ~a?")
+ directory)))
+ (_ #f)))))
(define (url+commit->name url sha1)
"Return the string \"<REPO-NAME>-<SHA1:7>\" where REPO-NAME is the name of