[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: emacs-build-system: Handle missing programs when patching.
From: |
Christopher Baines |
Subject: |
01/02: emacs-build-system: Handle missing programs when patching. |
Date: |
Sun, 15 Oct 2017 14:02:59 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository guix.
commit dd2de2842344ede8e92459fe66c5a45ca3dc40ff
Author: Christopher Baines <address@hidden>
Date: Wed Oct 11 11:59:20 2017 +0100
emacs-build-system: Handle missing programs when patching.
Previously the string-append here would error, which isn't useful as it
doesn't tell you which command couldn't be found. To make the error
actionable, catch it earlier, and explicitly error.
* guix/build/emacs-build-system.scm (patch-el-files): Handle (which cmd)
returning #f.
---
guix/build/emacs-build-system.scm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/guix/build/emacs-build-system.scm
b/guix/build/emacs-build-system.scm
index 2404dbd..1474c80 100644
--- a/guix/build/emacs-build-system.scm
+++ b/guix/build/emacs-build-system.scm
@@ -92,8 +92,12 @@ store in '.el' files."
(el-dir (string-append out %install-suffix "/" elpa-name-ver))
(substitute-cmd (lambda ()
(substitute* (find-files "." "\\.el$")
- (("\"/bin/([^.].*)\"" _ cmd)
- (string-append "\"" (which cmd) "\""))))))
+ (("\"/bin/([^.].*)\"" _ cmd-name)
+ (let ((cmd (which cmd-name)))
+ (unless cmd
+ (error
+ "patch-el-files: unable to locate "
cmd-name))
+ (string-append "\"" cmd "\"")))))))
(with-directory-excursion el-dir
;; Some old '.el' files (e.g., tex-buf.el in AUCTeX) are still encoded
;; with the "ISO-8859-1" locale.