Use shell's builtin pwd.

Insisting on /bin/pwd is unnecessary nowadays.  Autoconf-generated
scripts have been using the shell's built-in "pwd" for a long time.`
This commit is contained in:
Ludovic Courtès 2015-12-02 23:58:15 -05:00 committed by Carlos O'Donell
parent 4de3b51e08
commit db340c904d
5 changed files with 18 additions and 19 deletions

View File

@ -1,3 +1,10 @@
2015-12-02 Ludovic Courtès <ludo@gnu.org>
* configure.ac: Use 'pwd -P' instead of '/bin/pwd'.
* configure: Regenerate.
* io/ftwtest-sh: Use 'pwd -P' instead of '/bin/pwd'.
* scripts/rellns-sh: Likewise. Remove 'pwd' variable.
2015-12-02 Carlos O'Donell <carlos@redhat.com> 2015-12-02 Carlos O'Donell <carlos@redhat.com>
* iconvdata/ibm930.c: Add comment explaining encoding uses. * iconvdata/ibm930.c: Add comment explaining encoding uses.

2
configure vendored
View File

@ -3228,7 +3228,7 @@ if test $libc_cv_cxx_link_ok != yes; then :
CXX= CXX=
fi fi
if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then
as_fn_error $? "you must configure in a separate build directory" "$LINENO" 5 as_fn_error $? "you must configure in a separate build directory" "$LINENO" 5
fi fi

View File

@ -80,7 +80,7 @@ LDFLAGS="$old_LDFLAGS"
AC_LANG_POP([C++])]) AC_LANG_POP([C++])])
AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=]) AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=])
if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then
AC_MSG_ERROR([you must configure in a separate build directory]) AC_MSG_ERROR([you must configure in a separate build directory])
fi fi

View File

@ -135,7 +135,7 @@ $testprogram --chdir $tmpdir |
sort > $testout sort > $testout
# perhaps $tmp involves some symlinks... # perhaps $tmp involves some symlinks...
tmpreal=`cd $tmp; /bin/pwd 2>/dev/null || /usr/bin/pwd` tmpreal=`cd $tmp; pwd -P 2>/dev/null`
cat <<EOF | cmp $testout - || exit 1 cat <<EOF | cmp $testout - || exit 1
base = "$tmp/", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0 base = "$tmp/", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0
@ -153,7 +153,7 @@ base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd
EOF EOF
rm $testout rm $testout
curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd` curwd=`pwd -P 2>/dev/null`
cd "$tmp" cd "$tmp"
$testprogram --chdir ftwtest.d | $testprogram --chdir ftwtest.d |
sort > $testout sort > $testout
@ -175,7 +175,7 @@ base = "ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tm
EOF EOF
rm $testout rm $testout
curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd` curwd=`pwd -P`
cd "$tmp" cd "$tmp"
$testprogram --chdir ftwtest.d/. | $testprogram --chdir ftwtest.d/. |
sort > $testout sort > $testout
@ -197,7 +197,7 @@ base = "ftwtest.d/./foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $
EOF EOF
rm $testout rm $testout
curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd` curwd=`pwd -P 2>/dev/null`
cd "$tmp" cd "$tmp"
$testprogram --chdir ftwtest.d/foo/lvl1/link@1 | $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
sort > $testout sort > $testout

View File

@ -30,23 +30,15 @@ if test $# -ne 2; then
exit 1 exit 1
fi fi
if test -x /bin/pwd; then
pwd=/bin/pwd
elif test -x /usr/bin/pwd; then
pwd=/usr/bin/pwd
else
pwd='pwd'
fi
# Make both paths absolute. # Make both paths absolute.
if test -d $1; then if test -d $1; then
to=`cd $1 && $pwd` to=`cd $1 && pwd -P`
else else
temp=`echo $1 | sed 's%/*[^/]*$%%'` temp=`echo $1 | sed 's%/*[^/]*$%%'`
if test -z "$temp"; then if test -z "$temp"; then
to=`$pwd` to=`pwd -P`
else else
to=`cd $temp && $pwd` to=`cd $temp && pwd -P`
fi fi
to="$to/`echo $1 | sed 's%.*/\([^/][^/]*\)$%\1%'`" to="$to/`echo $1 | sed 's%.*/\([^/][^/]*\)$%\1%'`"
fi fi
@ -59,9 +51,9 @@ else
fi fi
if test -z "$from"; then if test -z "$from"; then
from=`$pwd | sed 's%^/%%'` from=`pwd -P | sed 's%^/%%'`
else else
from=`cd $from && $pwd | sed 's%^/%%'` from=`cd $from && pwd -P | sed 's%^/%%'`
fi fi
while test -n "$to" && test -n "$from"; do while test -n "$to" && test -n "$from"; do