[PATCH] Don't use Bash-specific ${parameter/pattern/string} expansion

Patrick 'P. J.' McDermott pj+sourceware-ml@pehjota.net
Mon Sep 9 15:22:00 GMT 2013


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/



More information about the Libc-alpha mailing list