From: ludo@gnu.org (Ludovic Courtès)
To: Eric Bavier <ericbavier@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] utils: Preserve makefile shell arguments during patch.
Date: Thu, 28 Aug 2014 13:44:23 +0200 [thread overview]
Message-ID: <87ha0wet48.fsf@gnu.org> (raw)
In-Reply-To: <874mwydjwe.fsf@member.fsf.org> (Eric Bavier's message of "Wed, 27 Aug 2014 10:36:33 -0500")
Eric Bavier <ericbavier@gmail.com> skribis:
> While working with some Imake-based packages recently, I found that
> patch-makefile-SHELL did not like when the SHELL definition contained
> arguments. For example, one package would define::
>
> SHELL = /bin/sh -e
>
> And patch-makefile-SHELL would turn that into::
>
> SHELL = /gnu/store/.../bin/bash
> -e
Oops.
> --- a/guix/build/utils.scm
> +++ b/guix/build/utils.scm
> @@ -582,14 +582,14 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged."
>
> (let ((st (stat file)))
> (substitute* file
> - (("^ *SHELL[[:blank:]]*=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)[[:blank:]]*" _ dir shell)
> + (("^ *SHELL[[:blank:]]*=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)[[:blank:]]*(.*)$" _ dir shell args)
Please add a line break after the regexp.
> (let* ((old (string-append dir shell))
> (new (or (find-shell shell) old)))
> (unless (string=? new old)
> (format (current-error-port)
> "patch-makefile-SHELL: ~a: changing `SHELL' from `~a' to `~a'~%"
> file old new))
> - (string-append "SHELL = " new "\n"))))
> + (string-append "SHELL = " new " " args))))
Are you sure the \n is no longer needed? (I can never remember when it
is matched and when it’s not.)
OK to commit with \n correctly handled.
Thanks!
Ludo’.
next prev parent reply other threads:[~2014-08-28 11:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 15:36 [PATCH] utils: Preserve makefile shell arguments during patch Eric Bavier
2014-08-28 11:44 ` Ludovic Courtès [this message]
2014-08-28 14:46 ` Eric Bavier
2014-08-28 15:41 ` Ludovic Courtès
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=87ha0wet48.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=ericbavier@gmail.com \
--cc=guix-devel@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.