summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2007-07-14 09:38:42 +0200
committerJim Meyering <jim@meyering.net>2007-07-14 09:38:42 +0200
commit1ff9e235e7413c7f945cc87cb3d4fe9ab0464d3b (patch)
tree1f14152c2875b81efad51ce12cbee033a973916b
parent916fcda554f5859ee51c4fb13031728a54d92a52 (diff)
downloadcoreutils-1ff9e235e7413c7f945cc87cb3d4fe9ab0464d3b.tar.xz
* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/.
(gl_INCLUDE_EXCLUDE_PROG): Quote first use of $2 parameter. Don't mix comma- and space-separated lists. Patch from Karel Zak.
-rw-r--r--ChangeLog7
-rw-r--r--m4/include-exclude-prog.m417
2 files changed, 17 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 668e303e4..5d570e45a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-07-14 Karel Zak <kzak@redhat.com>
+
+ * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/.
+ (gl_INCLUDE_EXCLUDE_PROG): Quote first use of $2 parameter.
+ Don't mix comma- and space-separated lists.
+ Patch from Karel Zak.
+
2007-07-13 Jim Meyering <jim@meyering.net>
Warn about non-portable use of unescaped backslash at end of string,
diff --git a/m4/include-exclude-prog.m4 b/m4/include-exclude-prog.m4
index 77627ea0e..32447f592 100644
--- a/m4/include-exclude-prog.m4
+++ b/m4/include-exclude-prog.m4
@@ -19,7 +19,7 @@ AC_DEFUN([gl_ADD_PROG],
# Usage: gl_REMOVE_PROG([prog_list_var_name], [prog_name])
AC_DEFUN([gl_REMOVE_PROG],
[{
- $1=`echo "$$1"|sed 's/\<'"$1"'\>//;s/ */ /g;s/^ *//;s/ *$//'`
+ $1=`echo "$$1"|sed 's/\<'"$2"'\>//;s/ */ /g;s/^ *//;s/ *$//'`
}])
# Given the name of a variable containing a space-separated list of
@@ -30,7 +30,7 @@ AC_DEFUN([gl_REMOVE_PROG],
# Usage: gl_INCLUDE_EXCLUDE_PROG([prog_list_var_name], [NI_prog1])
AC_DEFUN([gl_INCLUDE_EXCLUDE_PROG],
[{
- gl_no_install_progs_default=$2
+ gl_no_install_progs_default=`echo "$2"|tr -s , ' '`
AC_ARG_ENABLE([install-program],
[AS_HELP_STRING([--enable-install-program=PROG_LIST],
[install the programs in PROG_LIST (comma-separated,
@@ -49,15 +49,18 @@ AC_DEFUN([gl_INCLUDE_EXCLUDE_PROG],
[gl_no_install_prog=]
)
+ # Convert to space separated lists.
+ gl_do_install_prog=`echo "$gl_do_install_prog"|tr -s , ' '`
+ gl_no_install_prog=`echo "$gl_no_install_prog"|tr -s , ' '`
+
# For each not-to-be-installed program name, ensure that it's a
# valid name, remove it from the list of programs to build/install,
# as well as from the list of man pages to install.
- extra_programs=
- for gl_i in `echo "$gl_no_install_prog"|tr -s , ' '`; do
+ for gl_i in $gl_no_install_prog; do
# Fail upon a request to install and not-install the same program.
- case ",$gl_do_install_prog," in
- *",$gl_i,"*) AC_MSG_ERROR(['$gl_i' is both included and excluded]) ;;
+ case " $gl_do_install_prog " in
+ *" $gl_i "*) AC_MSG_ERROR(['$gl_i' is both included and excluded]) ;;
esac
gl_msg=
@@ -79,7 +82,7 @@ AC_DEFUN([gl_INCLUDE_EXCLUDE_PROG],
test "$gl_msg" != '' && AC_MSG_WARN([$gl_msg])
done
- for gl_i in `echo "$gl_do_install_prog"|tr -s , ' '`; do
+ for gl_i in $gl_do_install_prog; do
case " $gl_no_install_progs_default " in
*" $gl_i "*) gl_ADD_PROG([$1], $gl_i) ;;
*) AC_MSG_WARN(['$gl_i' is not an optionally-installable program]) ;;