guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#28787] [PATCH 1/2] emacs-build-system: Handle missing programs when


From: Christopher Baines
Subject: [bug#28787] [PATCH 1/2] emacs-build-system: Handle missing programs when patching.
Date: Wed, 11 Oct 2017 15:42:17 +0100

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 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/build/emacs-build-system.scm 
b/guix/build/emacs-build-system.scm
index 2404dbddb..0260f15bb 100644
--- a/guix/build/emacs-build-system.scm
+++ b/guix/build/emacs-build-system.scm
@@ -93,7 +93,12 @@ store in '.el' files."
          (substitute-cmd (lambda ()
                            (substitute* (find-files "." "\\.el$")
                              (("\"/bin/([^.].*)\"" _ cmd)
-                              (string-append "\"" (which cmd) "\""))))))
+                              (string-append
+                               "\""
+                               (or
+                                (which cmd)
+                                (error "patch-el-files: unable to locate " 
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.
-- 
2.14.2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]