From: Christopher Baines <mail@cbaines.net>
To: 28787@debbugs.gnu.org
Subject: [bug#28787] [PATCH 1/2] emacs-build-system: Handle missing programs when patching.
Date: Wed, 11 Oct 2017 15:42:17 +0100 [thread overview]
Message-ID: <20171011144218.26718-1-mail@cbaines.net> (raw)
In-Reply-To: <20171011154029.16fe9aa4@cbaines.net>
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
next prev parent reply other threads:[~2017-10-11 14:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 14:40 [bug#28787] [PATCH] emacs-build-system: Improve command patching Christopher Baines
2017-10-11 14:42 ` Christopher Baines [this message]
2017-10-11 14:42 ` [bug#28787] [PATCH 2/2] emacs-build-system: Change how patch-el-files substitutes commands Christopher Baines
2017-10-13 21:40 ` Ludovic Courtès
2017-10-15 18:09 ` bug#28787: " Christopher Baines
2017-10-13 21:40 ` [bug#28787] [PATCH 1/2] emacs-build-system: Handle missing programs when patching Ludovic Courtès
2017-10-15 18:06 ` Christopher Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171011144218.26718-1-mail@cbaines.net \
--to=mail@cbaines.net \
--cc=28787@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.