* m4sh.m4 (AS_MKDIR_P, AS_DIRNAME_SED): Don't shell quote $1.

Adjust callers.
Reported by Paul Eggert.
* tests/m4sh.at: Sort.
This commit is contained in:
Akim Demaille 2000-11-10 10:14:44 +00:00
parent ef0983118d
commit f9fd1e4edc
6 changed files with 60 additions and 53 deletions

View File

@ -1,3 +1,10 @@
2000-11-10 Akim Demaille <akim@epita.fr>
* m4sh.m4 (AS_MKDIR_P, AS_DIRNAME_SED): Don't shell quote $1.
Adjust callers.
Reported by Paul Eggert.
* tests/m4sh.at: Sort.
2000-11-09 Pavel Roskin <proski@gnu.org>
* install-sh: Use ":" instead of "true".

View File

@ -2698,7 +2698,7 @@ dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
echo $ECHO_N "checking for prefix by $ECHO_C" >&AC_FD_MSG
AC_PATH_PROG(m4_quote(AC_Prog), [$1])
if test -n "$ac_cv_path_[]AC_Prog"; then
prefix=`AS_DIRNAME([$ac_cv_path_[]AC_Prog])`
prefix=`AS_DIRNAME(["$ac_cv_path_[]AC_Prog"])`
fi
fi
m4_popdef([AC_Prog])dnl
@ -4273,9 +4273,9 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
ac_dir=`AS_DIRNAME("$ac_file")`
ac_dir=`AS_DIRNAME(["$ac_file"])`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
AS_MKDIR_P("$ac_dir")
AS_MKDIR_P(["$ac_dir"])
ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo "$ac_dir_suffix" | sed 's,/[[^/]]*,../,g'`
@ -4595,9 +4595,9 @@ cat >>$CONFIG_STATUS <<\EOF
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
echo "$ac_file is unchanged"
else
ac_dir=`AS_DIRNAME("$ac_file")`
ac_dir=`AS_DIRNAME(["$ac_file"])`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
AS_MKDIR_P("$ac_dir")
AS_MKDIR_P(["$ac_dir"])
fi
rm -f $ac_file
mv $tmp/config.h $ac_file
@ -4646,9 +4646,9 @@ for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
rm -f $ac_dest
# Make relative symlinks.
ac_dest_dir=`AS_DIRNAME("$ac_dest")`
ac_dest_dir=`AS_DIRNAME(["$ac_dest"])`
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
AS_MKDIR_P("$ac_dest_dir")
AS_MKDIR_P(["$ac_dest_dir"])
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's,^\./,,'`"
# A "../" for each directory in $ac_dest_dir_suffix.
ac_dots=`echo $ac_dest_dir_suffix|sed 's,/[[^/]]*,../,g'`
@ -4757,10 +4757,10 @@ AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
echo configuring in $ac_subdir
case $srcdir in
.) ;;
*) AS_MKDIR_P(./$ac_subdir)
*) AS_MKDIR_P(["./$ac_subdir"])
if test -d ./$ac_subdir; then :;
else
AC_MSG_ERROR(cannot create `pwd`/$ac_subdir)
AC_MSG_ERROR([cannot create `pwd`/$ac_subdir])
fi
;;
esac

View File

@ -2698,7 +2698,7 @@ dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
echo $ECHO_N "checking for prefix by $ECHO_C" >&AC_FD_MSG
AC_PATH_PROG(m4_quote(AC_Prog), [$1])
if test -n "$ac_cv_path_[]AC_Prog"; then
prefix=`AS_DIRNAME([$ac_cv_path_[]AC_Prog])`
prefix=`AS_DIRNAME(["$ac_cv_path_[]AC_Prog"])`
fi
fi
m4_popdef([AC_Prog])dnl
@ -4273,9 +4273,9 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
ac_dir=`AS_DIRNAME("$ac_file")`
ac_dir=`AS_DIRNAME(["$ac_file"])`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
AS_MKDIR_P("$ac_dir")
AS_MKDIR_P(["$ac_dir"])
ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo "$ac_dir_suffix" | sed 's,/[[^/]]*,../,g'`
@ -4595,9 +4595,9 @@ cat >>$CONFIG_STATUS <<\EOF
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
echo "$ac_file is unchanged"
else
ac_dir=`AS_DIRNAME("$ac_file")`
ac_dir=`AS_DIRNAME(["$ac_file"])`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
AS_MKDIR_P("$ac_dir")
AS_MKDIR_P(["$ac_dir"])
fi
rm -f $ac_file
mv $tmp/config.h $ac_file
@ -4646,9 +4646,9 @@ for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
rm -f $ac_dest
# Make relative symlinks.
ac_dest_dir=`AS_DIRNAME("$ac_dest")`
ac_dest_dir=`AS_DIRNAME(["$ac_dest"])`
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
AS_MKDIR_P("$ac_dest_dir")
AS_MKDIR_P(["$ac_dest_dir"])
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's,^\./,,'`"
# A "../" for each directory in $ac_dest_dir_suffix.
ac_dots=`echo $ac_dest_dir_suffix|sed 's,/[[^/]]*,../,g'`
@ -4757,10 +4757,10 @@ AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
echo configuring in $ac_subdir
case $srcdir in
.) ;;
*) AS_MKDIR_P(./$ac_subdir)
*) AS_MKDIR_P(["./$ac_subdir"])
if test -d ./$ac_subdir; then :;
else
AC_MSG_ERROR(cannot create `pwd`/$ac_subdir)
AC_MSG_ERROR([cannot create `pwd`/$ac_subdir])
fi
;;
esac

View File

@ -133,7 +133,7 @@ m4_define([AS_MKDIR_P],
[[\\/]]* | ?:[[\\/]]* ) ac_incr_dir=;;
*) ac_incr_dir=.;;
esac
ac_dummy="$1"
ac_dummy=$1
for ac_mkdir_dir in `IFS=/; set X $ac_dummy; shift; echo "$[@]"`; do
ac_incr_dir=$ac_incr_dir/$ac_mkdir_dir
test -d $ac_incr_dir || mkdir $ac_incr_dir
@ -160,7 +160,7 @@ m4_define([AS_DIRNAME_EXPR],
. : '\(.\)'])
m4_define([AS_DIRNAME_SED],
[echo "X[]$1" |
[echo X[]$1 |
sed ['/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }

View File

@ -133,7 +133,7 @@ m4_define([AS_MKDIR_P],
[[\\/]]* | ?:[[\\/]]* ) ac_incr_dir=;;
*) ac_incr_dir=.;;
esac
ac_dummy="$1"
ac_dummy=$1
for ac_mkdir_dir in `IFS=/; set X $ac_dummy; shift; echo "$[@]"`; do
ac_incr_dir=$ac_incr_dir/$ac_mkdir_dir
test -d $ac_incr_dir || mkdir $ac_incr_dir
@ -160,7 +160,7 @@ m4_define([AS_DIRNAME_EXPR],
. : '\(.\)'])
m4_define([AS_DIRNAME_SED],
[echo "X[]$1" |
[echo X[]$1 |
sed ['/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }

View File

@ -7,36 +7,6 @@ Autoshell.
EOF
## ------------ ##
## AS_MKDIR_P. ##
## ------------ ##
# Build nested dirs.
AT_SETUP(AC_SHELL_MKDIR_P)
AT_DATA(configure.in,
[[AC_PLAIN_SCRIPT
pwd=`pwd`
set -e
# Absolute
AS_MKDIR_P($pwd/1/2/3/4/5/6)
test -d $pwd/1/2/3/4/5/6 ||
AC_MSG_ERROR([$pwd/1/2/3/4/5/6 has not been properly created])
# Relative
AS_MKDIR_P(a/b/c/d/e/f)
test -d a/b/c/d/e/f ||
AC_MSG_ERROR([a/b/c/d/e/f has not been properly created])
AS_EXIT(0)
]])
AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
AT_CHECK([./configure], 0)
AT_CLEANUP(configure 1 a)
## ----------------------------- ##
## AS_DIRNAME & AS_DIRNAME_SED. ##
## ----------------------------- ##
@ -102,7 +72,37 @@ AS_DIRNAME_SED_TEST([../../2//3/], [../../2])
AS_EXIT(0)
]])
AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
AT_CHECK([./configure], 0)
AT_CLEANUP(configure)
## ------------ ##
## AS_MKDIR_P. ##
## ------------ ##
# Build nested dirs.
AT_SETUP(AC_SHELL_MKDIR_P)
AT_DATA(configure.in,
[[AC_PLAIN_SCRIPT
pwd=`pwd`
set -e
# Absolute
AS_MKDIR_P(["$pwd/1/2/3/4/5/6"])
test -d "$pwd/1/2/3/4/5/6" ||
AC_MSG_ERROR([$pwd/1/2/3/4/5/6 has not been properly created])
# Relative
AS_MKDIR_P(["a/b/c/d/e/f"])
test -d a/b/c/d/e/f ||
AC_MSG_ERROR([a/b/c/d/e/f has not been properly created])
AS_EXIT(0)
]])
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
AT_CHECK([./configure], 0)
AT_CLEANUP(configure 1 a)