From: ludo@gnu.org (Ludovic Courtès)
To: Eric Bavier <ericbavier@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] utils: Clean trailing whitespace at end of SHELL
Date: Thu, 04 Sep 2014 21:31:54 +0200 [thread overview]
Message-ID: <87ppfb89n9.fsf@gnu.org> (raw)
In-Reply-To: <87bnqv31hc.fsf@member.fsf.org> (Eric Bavier's message of "Thu, 04 Sep 2014 09:27:11 -0500")
[-- Attachment #1: Type: text/plain, Size: 1225 bytes --]
Eric Bavier <ericbavier@gmail.com> skribis:
> I found an unfortunate bug in the last patch I made to
> patch-makefile-SHELL that would leave a trailing ' ' at the end of SHELL
> assignments. This is fine for most packages, but caused
> gobject-introspection to fail building for me just now (for the curious:
> it effectively does an "(apply system* (string-split (string-append SHELL
> " " "./libtool") #\space))" which causes sh to try to execute "")
AFAIK trailing whitespace in assignments is ignored by ‘make’.
I grepped gobject-introspection out of curiosity and couldn’t find any
suspicious SHELL assignment. Do you still have it around?
> --- a/guix/build/utils.scm
> +++ b/guix/build/utils.scm
> @@ -590,7 +590,7 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged."
> (format (current-error-port)
> "patch-makefile-SHELL: ~a: changing `SHELL' from `~a' to `~a'~%"
> file old new))
> - (string-append "SHELL = " new " " args))))
> + (string-append "SHELL = " new (if (string=? args "\n") "" " ") args))))
The (string=? args "\n") seems specific and non-obvious.
Wouldn’t this work better:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 572 bytes --]
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index f38b2ca..057dcd2 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -582,7 +582,7 @@ 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:]]*(.*)$"
+ (("^ *SHELL[[:blank:]]*=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)(.*)$"
_ dir shell args)
(let* ((old (string-append dir shell))
(new (or (find-shell shell) old)))
[-- Attachment #3: Type: text/plain, Size: 21 bytes --]
Thanks,
Ludo’.
next prev parent reply other threads:[~2014-09-04 19:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-04 14:27 [PATCH] utils: Clean trailing whitespace at end of SHELL Eric Bavier
2014-09-04 19:31 ` Ludovic Courtès [this message]
2014-09-05 5:05 ` Eric Bavier
2014-09-05 8:11 ` 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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ppfb89n9.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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).