pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/bootstrap Replaced the hard-coded /bin/bash with an en...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a10f462b4ebf
branches:  trunk
changeset: 532218:a10f462b4ebf
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Aug 14 00:26:58 2007 +0000

description:
Replaced the hard-coded /bin/bash with an environment variable.

diffstat:

 bootstrap/bootstrap |  27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diffs (57 lines):

diff -r ddd8af35e1af -r a10f462b4ebf bootstrap/bootstrap
--- a/bootstrap/bootstrap       Tue Aug 14 00:14:18 2007 +0000
+++ b/bootstrap/bootstrap       Tue Aug 14 00:26:58 2007 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.106 2007/08/13 22:48:59 rillig Exp $
+# $NetBSD: bootstrap,v 1.107 2007/08/14 00:26:58 rillig Exp $
 #
 #
 # Copyright (c) 2001-2002 Alistair G. Crooks.  All rights reserved.
@@ -37,7 +37,7 @@
 
 # the following environment variables are honored:
 # compiler/linker flags: CFLAGS, CPPFLAGS, LDFLAGS
-# tools: CP, GREP, ID, MKDIR, TEST, TOUCH, XARGS
+# tools: CP, GREP, ID, MKDIR, SH, TEST, TOUCH, XARGS
 
 
 BOOTSTRAP_VERSION=20060721
@@ -261,6 +261,20 @@
        expr "x$1" : "x[^=]*=\\(.*\\)"
 }
 
+bootstrap_sh=${SH-/bin/sh}
+bootstrap_sh_set=${SH+set}
+
+# On some newer Ubuntu installations, /bin/sh is a symlink to /bin/dash,
+# whose echo(1) is not BSD-compatible.
+dash_echo_test=`$bootstrap_sh -c 'echo "\\100"'`
+if [ "$dash_echo_test" = "@" ]; then
+       { echo "ERROR: Your shell's echo command is not BSD-compatible."
+         echo "ERROR: Please select another shell by setting the environment"
+         echo "ERROR: variable SH."
+       } 1>&2
+       exit 1;
+fi
+
 build_start=`date`
 echo_msg "bootstrap command: $0 $@"
 echo_msg "bootstrap started: $build_start"
@@ -838,12 +852,9 @@
 MAKECONF=$wrkdir/mk.conf
 export MAKECONF
 
-# On some newer Ubuntu installations, /bin/sh is a symlink to /bin/dash,
-# whose echo(1) is not BSD-compatible.
-dash_echo_test=`echo "\\100"`
-if [ "$dash_echo_test" = "@" ]; then
-       echo "TOOLS_PLATFORM.sh?=               /bin/bash       # instead of /bin/sh" >> ${TARGET_MKCONF}
-       echo "TOOLS_PLATFORM.sh?=               /bin/bash       # instead of /bin/sh" >> ${BOOTSTRAP_MKCONF}
+if [ "$bootstrap_sh_set" = "set" ]; then
+       echo "TOOLS_PLATFORM.sh?=               ${bootstrap_sh}" >> ${TARGET_MKCONF}
+       echo "TOOLS_PLATFORM.sh?=               ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF}
 fi
 
 # preserve compiler and tool environment variables settings



Home | Main Index | Thread Index | Old Index