From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2IDx-0007mR-62 for guix-patches@gnu.org; Wed, 11 Oct 2017 10:43:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2IDu-00011u-1S for guix-patches@gnu.org; Wed, 11 Oct 2017 10:43:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:53918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2IDt-00011n-Tj for guix-patches@gnu.org; Wed, 11 Oct 2017 10:43:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e2IDt-0002oX-NL for guix-patches@gnu.org; Wed, 11 Oct 2017 10:43:01 -0400 Subject: [bug#28787] [PATCH 1/2] emacs-build-system: Handle missing programs when patching. References: <20171011154029.16fe9aa4@cbaines.net> In-Reply-To: <20171011154029.16fe9aa4@cbaines.net> Resent-Message-ID: From: Christopher Baines Date: Wed, 11 Oct 2017 15:42:17 +0100 Message-Id: <20171011144218.26718-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28787@debbugs.gnu.org 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