mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 06:18:07 -05:00
style: Gracefully handle errors such as EACCES when opening files.
* guix/scripts/style.scm (guix-style): Wrap body in 'with-error-handling'.
This commit is contained in:
parent
a9892f8f2d
commit
f6e79ef108
1 changed files with 12 additions and 11 deletions
|
@ -543,14 +543,15 @@ (define (parse-options)
|
|||
edit-expression/dry-run
|
||||
edit-expression))
|
||||
(policy (assoc-ref opts 'input-simplification-policy)))
|
||||
(for-each (lambda (package)
|
||||
(simplify-package-inputs package #:policy policy
|
||||
#:edit-expression edit))
|
||||
;; Sort package by source code location so that we start editing
|
||||
;; files from the bottom and going upward. That way, the
|
||||
;; 'location' field of <package> records is not invalidated as
|
||||
;; we modify files.
|
||||
(sort (if (null? packages)
|
||||
(fold-packages cons '() #:select? (const #t))
|
||||
packages)
|
||||
(negate package-location<?)))))
|
||||
(with-error-handling
|
||||
(for-each (lambda (package)
|
||||
(simplify-package-inputs package #:policy policy
|
||||
#:edit-expression edit))
|
||||
;; Sort package by source code location so that we start editing
|
||||
;; files from the bottom and going upward. That way, the
|
||||
;; 'location' field of <package> records is not invalidated as
|
||||
;; we modify files.
|
||||
(sort (if (null? packages)
|
||||
(fold-packages cons '() #:select? (const #t))
|
||||
packages)
|
||||
(negate package-location<?))))))
|
||||
|
|
Loading…
Reference in a new issue