+2007-03-30 Eric Blake <ebb9@byu.net>
+ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * lib/mdate-sh (ls_command): Use -n when available to avoid
+ problems with spaces in user/group names.
+ * tests/mdate5.test: New test.
+ * tests/Makefile.am: Adjust.
+
2007-03-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* automake.in (handle_tests): Rewrite XFAIL_TESTS just like
#!/bin/sh
# Get modification time of a file or directory and pretty-print it.
-scriptversion=2005-06-29.22
+scriptversion=2007-03-30.02
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
+# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software
# Foundation, Inc.
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
#
else
ls_command='ls -l -d'
fi
+# Avoid user/group names that might have spaces, when possible.
+if ls -n /dev/null 1>/dev/null 2>&1; then
+ ls_command="$ls_command -n"
+fi
# A `ls -l' line looks as follows on OS/2.
# drwxrwx--- 0 Aug 11 2001 foo
# words should be skipped to get the date.
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
-set x`ls -l -d /`
+set x`$ls_command /`
# Find which argument is the month.
month=
--- /dev/null
+#! /bin/sh
+# Copyright (C) 1999, 2001, 2002, 2004, 2007 Free Software Foundation,
+# Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Test to make sure mdate-sh works correctly.
+
+. ./defs || exit 1
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = textutils.texi
+END
+
+cat > textutils.texi << 'END'
+@include version.texi
+@setfilename textutils.info
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+
+set x `$SHELL ./mdate-sh Makefile.am`
+shift
+# Check that mdate output looks like a date:
+test $# = 3
+case $1$3 in *[!0-9]*) exit 1;; esac
+test $1 -lt 32