2N/A# Get modification time of a file or directory and pretty-print it. 2N/A# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software 2N/A# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995 2N/A# This program is free software; you can redistribute it and/or modify 2N/A# it under the terms of the GNU General Public License as published by 2N/A# the Free Software Foundation; either version 3, or (at your option) 2N/A# This program is distributed in the hope that it will be useful, 2N/A# but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A# GNU General Public License for more details. 2N/A# You should have received a copy of the GNU General Public License 2N/A# along with this program; if not, write to the Free Software Foundation, 2N/A# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 2N/A# As a special exception to the GNU General Public License, if you 2N/A# distribute this file as part of a program that contains a 2N/A# configuration script generated by Autoconf, you may include it under 2N/A# the same distribution terms that you use for the rest of that program. 2N/A# This file is maintained in Automake, please report 2N/A# bugs to <bug-automake@gnu.org> or send patches to 2N/A# <automake-patches@gnu.org>. 2N/A echo "$0: No file. Try \`$0 --help' for more information." 1>&
2 2N/A# Prevent date giving response in another language. 2N/A# GNU ls changes its time format in response to the TIME_STYLE 2N/A# variable. Since we cannot assume `unset' works, revert this 2N/A# variable to its documented default. 2N/Aif test "${TIME_STYLE+set}" =
set;
then 2N/A# Find out how to get the extended ls output of a file or directory. 2N/A# Avoid user/group names that might have spaces, when possible. 2N/A# A `ls -l' line looks as follows on OS/2. 2N/A# drwxrwx--- 0 Aug 11 2001 foo 2N/A# This differs from Unix, which adds ownership information. 2N/A# drwxrwx--- 2 root root 4096 Aug 11 2001 foo 2N/A# To find the date, we split the line on spaces and iterate on words 2N/A# until we find a month. This cannot work with files whose owner is a 2N/A# user named `Jan', or `Feb', etc. However, it's unlikely that `/' 2N/A# will be owned by a user whose name is a month. So we first look at 2N/A# the extended ls output of the root directory to decide how many 2N/A# words should be skipped to get the date. 2N/A# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. 2N/A# Find which argument is the month. 2N/A # Add another shift to the command. 2N/A# Get the extended ls output of the file or directory. 2N/A# Remove all preceding arguments 2N/A# Because of the dummy argument above, month is in $2. 2N/A# On a POSIX system, we should have 2N/A# On Darwin 7.7.0 and 7.6.0, we have 2N/A# Here we have to deal with the problem that the ls output gives either 2N/A# the time of day or the year. 2N/A # For the first six month of the year the time notation can also 2N/A # be used for files modified in the last year. 2N/A# eval: (add-hook 'write-file-hooks 'time-stamp) 2N/A# time-stamp-start: "scriptversion=" 2N/A# time-stamp-format: "%:y-%02m-%02d.%02H" 2N/A# time-stamp-end: "$"