[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/10: style: Gracefully handle errors such as EACCES when opening files
From: |
guix-commits |
Subject: |
10/10: style: Gracefully handle errors such as EACCES when opening files. |
Date: |
Sat, 18 Dec 2021 16:54:10 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit f6e79ef108a206a2fb3db550d76de760d581f8a8
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Dec 18 22:49:40 2021 +0100
style: Gracefully handle errors such as EACCES when opening files.
* guix/scripts/style.scm (guix-style): Wrap body in
'with-error-handling'.
---
guix/scripts/style.scm | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm
index 01196eb..3b246e9 100644
--- a/guix/scripts/style.scm
+++ b/guix/scripts/style.scm
@@ -543,14 +543,15 @@ Update package definitions to the latest style.\n"))
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<?))))))
- branch master updated (cfcfda5 -> f6e79ef), guix-commits, 2021/12/18
- 01/10: gnu: Add Guile-Plotutils., guix-commits, 2021/12/18
- 06/10: gnu: sssd: Fix build with glibc-2.33, guix-commits, 2021/12/18
- 05/10: gnu: Add xfoil., guix-commits, 2021/12/18
- 03/10: gnu: Move instrumentation tools to instrumentation module., guix-commits, 2021/12/18
- 09/10: style: Refer to source files by absolute file names., guix-commits, 2021/12/18
- 10/10: style: Gracefully handle errors such as EACCES when opening files.,
guix-commits <=
- 02/10: gnu: Add Dyninst., guix-commits, 2021/12/18
- 04/10: gnu: babeltrace, lttng-tools: Simplify inputs., guix-commits, 2021/12/18
- 07/10: import: elpa: Support ‘upstream-name’ property., guix-commits, 2021/12/18
- 08/10: gnu: go-ipfs: Update to 0.11.0., guix-commits, 2021/12/18