X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Frelocatable.sh.in;h=08fea0ce0bc3a67d362ecb6bcecbd43d0602a2d2;hb=cd56634a4a8179fd5a4419fbb3e27211b042ab1c;hp=493dd5e90091a13f55d4b7c01a6216da1de9a51d;hpb=545903807b8a32ecee8a21076896e4a3b4d44528;p=gnulib.git diff --git a/build-aux/relocatable.sh.in b/build-aux/relocatable.sh.in index 493dd5e90..08fea0ce0 100644 --- a/build-aux/relocatable.sh.in +++ b/build-aux/relocatable.sh.in @@ -6,12 +6,12 @@ # package by hand; see doc/relocatable-maint.texi (in Gnulib) for # details. # -# Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,8 +19,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # # func_tmpdir @@ -63,15 +62,14 @@ func_find_curr_installdir () */* | *\\*) ;; *) # Need to look in the PATH. if test "${PATH_SEPARATOR+set}" != set; then - func_tmpdir - { echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh - chmod +x "$tmp"/conf.sh - if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -rf "$tmp" + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi save_IFS="$IFS"; IFS="$PATH_SEPARATOR" for dir in $PATH; do