[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: |
Sun, 15 Oct 2017 19:06:08 +0100 |
On Fri, 13 Oct 2017 23:40:02 +0200
address@hidden (Ludovic Courtès) wrote:
> Hello!
>
> Christopher Baines <address@hidden> skribis:
>
> > 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))
> > + "\""))))))
>
> For clarity I’d move the ‘error’ 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.
pgp5qBchYdiND.pgp
Description: OpenPGP digital signature