mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00: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 @@ Update package definitions to the latest style.\n"))
|
||||||
edit-expression/dry-run
|
edit-expression/dry-run
|
||||||
edit-expression))
|
edit-expression))
|
||||||
(policy (assoc-ref opts 'input-simplification-policy)))
|
(policy (assoc-ref opts 'input-simplification-policy)))
|
||||||
(for-each (lambda (package)
|
(with-error-handling
|
||||||
(simplify-package-inputs package #:policy policy
|
(for-each (lambda (package)
|
||||||
#:edit-expression edit))
|
(simplify-package-inputs package #:policy policy
|
||||||
;; Sort package by source code location so that we start editing
|
#:edit-expression edit))
|
||||||
;; files from the bottom and going upward. That way, the
|
;; Sort package by source code location so that we start editing
|
||||||
;; 'location' field of <package> records is not invalidated as
|
;; files from the bottom and going upward. That way, the
|
||||||
;; we modify files.
|
;; 'location' field of <package> records is not invalidated as
|
||||||
(sort (if (null? packages)
|
;; we modify files.
|
||||||
(fold-packages cons '() #:select? (const #t))
|
(sort (if (null? packages)
|
||||||
packages)
|
(fold-packages cons '() #:select? (const #t))
|
||||||
(negate package-location<?)))))
|
packages)
|
||||||
|
(negate package-location<?))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue