]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/mdate-sh (ls_command): Use -n when available to avoid
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 29 Mar 2007 23:26:48 +0000 (23:26 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 29 Mar 2007 23:26:48 +0000 (23:26 +0000)
problems with spaces in user/group names.
* tests/mdate5.test: New test.
* tests/Makefile.am: Adjust.

ChangeLog
lib/mdate-sh
tests/Makefile.am
tests/Makefile.in
tests/mdate5.test [new file with mode: 0755]

index 4579c052190abf214b626224600196d6afd4e70c..03ee3c44fc5fcf3cb231d2079859cbcc445a29b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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
index cd916c0a34003205a3773df2c9a178a8139b4aad..83d27009dc223aaabde59623ce8873c8c6689f86 100755 (executable)
@@ -1,9 +1,9 @@
 #!/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
 #
@@ -75,6 +75,10 @@ if ls -L /dev/null 1>/dev/null 2>&1; then
 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
@@ -89,7 +93,7 @@ fi
 # 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=
index afa698b2383bea1189894706f11b6415950cb82e..df6ff8760c5b294f74cb4acbcd4096f1e4136b09 100644 (file)
@@ -367,6 +367,7 @@ mdate.test \
 mdate2.test \
 mdate3.test \
 mdate4.test \
+mdate5.test \
 missing.test \
 missing2.test \
 missing3.test \
index 7ca66fbfa89ee2e5d9d535027da013bb58572de6..f45ba3ea0d3db7e64591684dcd3da46f1770c479 100644 (file)
@@ -500,6 +500,7 @@ mdate.test \
 mdate2.test \
 mdate3.test \
 mdate4.test \
+mdate5.test \
 missing.test \
 missing2.test \
 missing3.test \
diff --git a/tests/mdate5.test b/tests/mdate5.test
new file mode 100755 (executable)
index 0000000..085563a
--- /dev/null
@@ -0,0 +1,48 @@
+#! /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