all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 28787@debbugs.gnu.org
Subject: [bug#28787] [PATCH 1/2] emacs-build-system: Handle missing programs when patching.
Date: Sun, 15 Oct 2017 19:06:08 +0100	[thread overview]
Message-ID: <20171015190608.7497eaeb@cbaines.net> (raw)
In-Reply-To: <871sm6zpzh.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1614 bytes --]

On Fri, 13 Oct 2017 23:40:02 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> Hello!
> 
> Christopher Baines <mail@cbaines.net> 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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

      reply	other threads:[~2017-10-15 18:07 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 ` [bug#28787] [PATCH 1/2] emacs-build-system: Handle missing programs when patching Christopher Baines
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 [this message]

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=20171015190608.7497eaeb@cbaines.net \
    --to=mail@cbaines.net \
    --cc=28787@debbugs.gnu.org \
    --cc=ludo@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.