On 07/18/2014 09:09 PM, Assaf Gordon wrote:
> Hi,
> 
> Trying to build the latest revision (in an existing 'coreutil' directory 
> after 'git pull', not a fresh clone),
> 
> "./bootstrap" fails at the very end with:
>     build-aux/gen-single-binary.sh: 52: build-aux/gen-single-binary.sh: Bad 
> substitution
>    ./bootstrap: bootstrap_post_import_hook failed
> 
> Line 52 of "build-aux/gen-single-binary.sh" has:
>    eval "$var='$oldvalue "${value//\'/\'\"\'\"\'}"'"
> 
> Which I guess is a non-posix standard parameter expansion ( $(VAR//} works in 
> bash but not in dash ).
> 
> As an ugly work-around, modifying "gen-single-binary.sh" from "#!/bin/sh" to 
> "#!/bin/bash" avoids the problem - so this is likely the culprit.
> 
> - Assaf

The attached should fix it up.
This is something that would be good to have in the 8.23 release I'm preparing,
as it would be common for users to:
  git checkout v8.23
  ./bootstrap
  ...

thanks!
Pádraig.

>From 421e16ac0dbc21aaa140655cf16d26bd33fbc92c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Fri, 18 Jul 2014 21:55:19 +0100
Subject: [PATCH] build: port new bootstrap script to POSIX shells

* build-aux/gen-single-binary.sh: Avoid bash only constructs.
Reported by Assaf Gordon
---
 build-aux/gen-single-binary.sh |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/build-aux/gen-single-binary.sh b/build-aux/gen-single-binary.sh
index 4635706..a2423e6 100755
--- a/build-aux/gen-single-binary.sh
+++ b/build-aux/gen-single-binary.sh
@@ -49,7 +49,8 @@ while read l; do
       if echo $l | grep -F '+=' >/dev/null; then
         eval "oldvalue=\${$var}"
       fi
-      eval "$var='$oldvalue "${value//\'/\'\"\'\"\'}"'"
+      value=$(echo "$value" | sed "s/'/'\"'\"'/g")
+      eval "$var='$oldvalue "$value"'"
     fi
   fi
 done < $LOCAL_MK
@@ -60,15 +61,15 @@ echo "## Automatically generated by $me.  DO NOT EDIT BY HAND!"
 # Override the sources for dir and vdir. We use a smaller version of dir and
 # vdir that relies on the ls main.
 src_dir_SOURCES="src/coreutils-dir.c"
-src_dir_LDADD+=" src/libsinglebin_ls.a"
+src_dir_LDADD="$src_dir_LDADD src/libsinglebin_ls.a"
 echo src_libsinglebin_dir_a_DEPENDENCIES = src/libsinglebin_ls.a
 src_vdir_SOURCES="src/coreutils-vdir.c"
-src_vdir_LDADD+=" src/libsinglebin_ls.a"
+src_vdir_LDADD="$src_vdir_LDADD src/libsinglebin_ls.a"
 echo src_libsinglebin_vdir_a_DEPENDENCIES = src/libsinglebin_ls.a
 
 # Override the sources for arch likewise, using the main from uname.
 src_arch_SOURCES="src/coreutils-arch.c"
-src_arch_LDADD+=" src/libsinglebin_uname.a"
+src_arch_LDADD="$src_arch_LDADD src/libsinglebin_uname.a"
 echo src_libsinglebin_arch_a_DEPENDENCIES = src/libsinglebin_uname.a
 
 for cmd in $ALL_PROGRAMS; do
-- 
1.7.7.6

Reply via email to