From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3nJa-0007SB-3p for guix-patches@gnu.org; Sun, 15 Oct 2017 14:07:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3nJW-0002HB-UL for guix-patches@gnu.org; Sun, 15 Oct 2017 14:07:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:33169) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3nJW-0002H1-Qu for guix-patches@gnu.org; Sun, 15 Oct 2017 14:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e3nJW-0005DO-An for guix-patches@gnu.org; Sun, 15 Oct 2017 14:07:02 -0400 Subject: [bug#28787] [PATCH 1/2] emacs-build-system: Handle missing programs when patching. Resent-Message-ID: Date: Sun, 15 Oct 2017 19:06:08 +0100 From: Christopher Baines Message-ID: <20171015190608.7497eaeb@cbaines.net> In-Reply-To: <871sm6zpzh.fsf@gnu.org> References: <20171011154029.16fe9aa4@cbaines.net> <20171011144218.26718-1-mail@cbaines.net> <871sm6zpzh.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/HoWPw9Gu1SGnzIyJZBpP6Yn"; protocol="application/pgp-signature" 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 28787@debbugs.gnu.org --Sig_/HoWPw9Gu1SGnzIyJZBpP6Yn Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 13 Oct 2017 23:40:02 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Hello! >=20 > Christopher Baines skribis: >=20 > > 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 loca= te " cmd)) > > + "\"")))))) =20 >=20 > For clarity I=E2=80=99d move the =E2=80=98error=E2=80=99 call out of the = way: This works for me. I've also changed the original cmd to cmd-name, to avoid using the same name for two different variables. --Sig_/HoWPw9Gu1SGnzIyJZBpP6Yn Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlnjo5BfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xe0og/9H2/8Sd5wHzHGqpJppOZPVzIRTv6es0TdgX0nv6hsVtEX9IFwak1HjDl+ j+KCzjUUk+Z1RIRX8obkX4KOc9ikIeQyX/0Cm/9M1NtGuiqAPP0nxMOZJXBR1UR8 wGdJVCU9kxUdS9Nd0vLCLKYtG2F4IxvedpRHPNNXYUDN76CAbnYFx9gShqI2xzvG iZVmmztdbfT6DmBi25FsAixNQVG/ZnUbTA5/b7EWBgkBmOXgFU0M9WxUIztWm+PB ieZY4trT/hrTIg+hXIYnFZC9PPsCsDPRriocPODo8g7+VOZkpVsh/VEqSATAMFIr ZSvztMGUk5dKTeMv3PKh8riPvSfKw7WYVkYeVjV8PD2dpel92Ta8XXvdR2EUstmY 3AOW88kV/8ez/Y+wgXKDKFet9O92PWNQSkfJoQPFn9KRo21mVprP+6WWgvJhezC2 UFtQIJ73iuHI5XD7XkpGDnBJV+BRvnMJbHzOBm03ZpfiRUIFHLDaCkKa8+RvWgpo AWkPEA4bb8JPbU7NprbQ5P5Dy7WmijnJnXAtDtYhUnPwpuE2H1W6ZLiV6zccN/Bu 99kDNwTcPOSycS47WOh3hAhnQPc/uSxWel0QdxO1B4QMnOBjNcC7V71QXrtMnoMq H0BsV3JS3H8gzgF/KcTr0Z2A9xWSu4P0cN6rg8KcKvjrH7nVqro= =2XPv -----END PGP SIGNATURE----- --Sig_/HoWPw9Gu1SGnzIyJZBpP6Yn--