This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Don't use Bash-specific ${parameter/pattern/string} expansion
- From: "Patrick 'P. J.' McDermott" <pj+sourceware-ml at pehjota dot net>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 09 Sep 2013 11:22:04 -0400
- Subject: Re: [PATCH] Don't use Bash-specific ${parameter/pattern/string} expansion
- Authentication-results: sourceware.org; auth=none
- References: <522CDBAD dot 8000104 at pehjota dot net> <Pine dot LNX dot 4 dot 64 dot 1309091330420 dot 25250 at digraph dot polyomino dot org dot uk>
On 2013-09-09 09:34, Joseph S. Myers wrote:
> On Sun, 8 Sep 2013, Patrick 'P. J.' McDermott wrote:
>
>> There's one other instance of this expansion syntax in the glibc tree
>> (scripts/cross-test-ssh.sh:106), but that file isn't used during the
>> build.
>
> More significantly, it's explicitly a bash script (#! /bin/bash), whereas
> make-syscalls.sh uses #! /bin/sh and is run with $(SHELL). Use of
> bash-specific syntax is only a bug when used in an sh script (#! /bin/sh,
> run with $(SHELL)). Although since we don't document bash as a build
> requirement in install.texi, if any bash scripts are required for the
> build there's at least a documentation bug.
Right. sysdeps/unix/make-syscalls.sh and sysdeps/unix/Makefile are
executed with $(SHELL) during the build, and they have an undocumented
dependency on Bash. This patch fixes that.
scripts/cross-test-ssh.sh could easily become a portable sh script. I
could make the necessary changes for that in the bourne_quote function
(and relax the "#!" interpreter statement) in another patch, if desired.
But I'm more concerned about the undocumented build-time dependency
addressed in this patch.
--
Patrick "P. J." McDermott
http://www.pehjota.net/
Lead Developer, ProteanOS
http://www.proteanos.com/