annotate fft/fftw/fftw-3.3.4/doc/mdate-sh @ 40:223f770b5341 kissfft-double tip

Try a double-precision kissfft
author Chris Cannam
date Wed, 07 Sep 2016 10:40:32 +0100
parents 26056e866c29
children
rev   line source
Chris@19 1 #!/bin/sh
Chris@19 2 # Get modification time of a file or directory and pretty-print it.
Chris@19 3
Chris@19 4 scriptversion=2010-08-21.06; # UTC
Chris@19 5
Chris@19 6 # Copyright (C) 1995-2013 Free Software Foundation, Inc.
Chris@19 7 # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
Chris@19 8 #
Chris@19 9 # This program is free software; you can redistribute it and/or modify
Chris@19 10 # it under the terms of the GNU General Public License as published by
Chris@19 11 # the Free Software Foundation; either version 2, or (at your option)
Chris@19 12 # any later version.
Chris@19 13 #
Chris@19 14 # This program is distributed in the hope that it will be useful,
Chris@19 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@19 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@19 17 # GNU General Public License for more details.
Chris@19 18 #
Chris@19 19 # You should have received a copy of the GNU General Public License
Chris@19 20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
Chris@19 21
Chris@19 22 # As a special exception to the GNU General Public License, if you
Chris@19 23 # distribute this file as part of a program that contains a
Chris@19 24 # configuration script generated by Autoconf, you may include it under
Chris@19 25 # the same distribution terms that you use for the rest of that program.
Chris@19 26
Chris@19 27 # This file is maintained in Automake, please report
Chris@19 28 # bugs to <bug-automake@gnu.org> or send patches to
Chris@19 29 # <automake-patches@gnu.org>.
Chris@19 30
Chris@19 31 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
Chris@19 32 emulate sh
Chris@19 33 NULLCMD=:
Chris@19 34 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
Chris@19 35 # is contrary to our usage. Disable this feature.
Chris@19 36 alias -g '${1+"$@"}'='"$@"'
Chris@19 37 setopt NO_GLOB_SUBST
Chris@19 38 fi
Chris@19 39
Chris@19 40 case $1 in
Chris@19 41 '')
Chris@19 42 echo "$0: No file. Try '$0 --help' for more information." 1>&2
Chris@19 43 exit 1;
Chris@19 44 ;;
Chris@19 45 -h | --h*)
Chris@19 46 cat <<\EOF
Chris@19 47 Usage: mdate-sh [--help] [--version] FILE
Chris@19 48
Chris@19 49 Pretty-print the modification day of FILE, in the format:
Chris@19 50 1 January 1970
Chris@19 51
Chris@19 52 Report bugs to <bug-automake@gnu.org>.
Chris@19 53 EOF
Chris@19 54 exit $?
Chris@19 55 ;;
Chris@19 56 -v | --v*)
Chris@19 57 echo "mdate-sh $scriptversion"
Chris@19 58 exit $?
Chris@19 59 ;;
Chris@19 60 esac
Chris@19 61
Chris@19 62 error ()
Chris@19 63 {
Chris@19 64 echo "$0: $1" >&2
Chris@19 65 exit 1
Chris@19 66 }
Chris@19 67
Chris@19 68
Chris@19 69 # Prevent date giving response in another language.
Chris@19 70 LANG=C
Chris@19 71 export LANG
Chris@19 72 LC_ALL=C
Chris@19 73 export LC_ALL
Chris@19 74 LC_TIME=C
Chris@19 75 export LC_TIME
Chris@19 76
Chris@19 77 # GNU ls changes its time format in response to the TIME_STYLE
Chris@19 78 # variable. Since we cannot assume 'unset' works, revert this
Chris@19 79 # variable to its documented default.
Chris@19 80 if test "${TIME_STYLE+set}" = set; then
Chris@19 81 TIME_STYLE=posix-long-iso
Chris@19 82 export TIME_STYLE
Chris@19 83 fi
Chris@19 84
Chris@19 85 save_arg1=$1
Chris@19 86
Chris@19 87 # Find out how to get the extended ls output of a file or directory.
Chris@19 88 if ls -L /dev/null 1>/dev/null 2>&1; then
Chris@19 89 ls_command='ls -L -l -d'
Chris@19 90 else
Chris@19 91 ls_command='ls -l -d'
Chris@19 92 fi
Chris@19 93 # Avoid user/group names that might have spaces, when possible.
Chris@19 94 if ls -n /dev/null 1>/dev/null 2>&1; then
Chris@19 95 ls_command="$ls_command -n"
Chris@19 96 fi
Chris@19 97
Chris@19 98 # A 'ls -l' line looks as follows on OS/2.
Chris@19 99 # drwxrwx--- 0 Aug 11 2001 foo
Chris@19 100 # This differs from Unix, which adds ownership information.
Chris@19 101 # drwxrwx--- 2 root root 4096 Aug 11 2001 foo
Chris@19 102 #
Chris@19 103 # To find the date, we split the line on spaces and iterate on words
Chris@19 104 # until we find a month. This cannot work with files whose owner is a
Chris@19 105 # user named "Jan", or "Feb", etc. However, it's unlikely that '/'
Chris@19 106 # will be owned by a user whose name is a month. So we first look at
Chris@19 107 # the extended ls output of the root directory to decide how many
Chris@19 108 # words should be skipped to get the date.
Chris@19 109
Chris@19 110 # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
Chris@19 111 set x`$ls_command /`
Chris@19 112
Chris@19 113 # Find which argument is the month.
Chris@19 114 month=
Chris@19 115 command=
Chris@19 116 until test $month
Chris@19 117 do
Chris@19 118 test $# -gt 0 || error "failed parsing '$ls_command /' output"
Chris@19 119 shift
Chris@19 120 # Add another shift to the command.
Chris@19 121 command="$command shift;"
Chris@19 122 case $1 in
Chris@19 123 Jan) month=January; nummonth=1;;
Chris@19 124 Feb) month=February; nummonth=2;;
Chris@19 125 Mar) month=March; nummonth=3;;
Chris@19 126 Apr) month=April; nummonth=4;;
Chris@19 127 May) month=May; nummonth=5;;
Chris@19 128 Jun) month=June; nummonth=6;;
Chris@19 129 Jul) month=July; nummonth=7;;
Chris@19 130 Aug) month=August; nummonth=8;;
Chris@19 131 Sep) month=September; nummonth=9;;
Chris@19 132 Oct) month=October; nummonth=10;;
Chris@19 133 Nov) month=November; nummonth=11;;
Chris@19 134 Dec) month=December; nummonth=12;;
Chris@19 135 esac
Chris@19 136 done
Chris@19 137
Chris@19 138 test -n "$month" || error "failed parsing '$ls_command /' output"
Chris@19 139
Chris@19 140 # Get the extended ls output of the file or directory.
Chris@19 141 set dummy x`eval "$ls_command \"\\\$save_arg1\""`
Chris@19 142
Chris@19 143 # Remove all preceding arguments
Chris@19 144 eval $command
Chris@19 145
Chris@19 146 # Because of the dummy argument above, month is in $2.
Chris@19 147 #
Chris@19 148 # On a POSIX system, we should have
Chris@19 149 #
Chris@19 150 # $# = 5
Chris@19 151 # $1 = file size
Chris@19 152 # $2 = month
Chris@19 153 # $3 = day
Chris@19 154 # $4 = year or time
Chris@19 155 # $5 = filename
Chris@19 156 #
Chris@19 157 # On Darwin 7.7.0 and 7.6.0, we have
Chris@19 158 #
Chris@19 159 # $# = 4
Chris@19 160 # $1 = day
Chris@19 161 # $2 = month
Chris@19 162 # $3 = year or time
Chris@19 163 # $4 = filename
Chris@19 164
Chris@19 165 # Get the month.
Chris@19 166 case $2 in
Chris@19 167 Jan) month=January; nummonth=1;;
Chris@19 168 Feb) month=February; nummonth=2;;
Chris@19 169 Mar) month=March; nummonth=3;;
Chris@19 170 Apr) month=April; nummonth=4;;
Chris@19 171 May) month=May; nummonth=5;;
Chris@19 172 Jun) month=June; nummonth=6;;
Chris@19 173 Jul) month=July; nummonth=7;;
Chris@19 174 Aug) month=August; nummonth=8;;
Chris@19 175 Sep) month=September; nummonth=9;;
Chris@19 176 Oct) month=October; nummonth=10;;
Chris@19 177 Nov) month=November; nummonth=11;;
Chris@19 178 Dec) month=December; nummonth=12;;
Chris@19 179 esac
Chris@19 180
Chris@19 181 case $3 in
Chris@19 182 ???*) day=$1;;
Chris@19 183 *) day=$3; shift;;
Chris@19 184 esac
Chris@19 185
Chris@19 186 # Here we have to deal with the problem that the ls output gives either
Chris@19 187 # the time of day or the year.
Chris@19 188 case $3 in
Chris@19 189 *:*) set `date`; eval year=\$$#
Chris@19 190 case $2 in
Chris@19 191 Jan) nummonthtod=1;;
Chris@19 192 Feb) nummonthtod=2;;
Chris@19 193 Mar) nummonthtod=3;;
Chris@19 194 Apr) nummonthtod=4;;
Chris@19 195 May) nummonthtod=5;;
Chris@19 196 Jun) nummonthtod=6;;
Chris@19 197 Jul) nummonthtod=7;;
Chris@19 198 Aug) nummonthtod=8;;
Chris@19 199 Sep) nummonthtod=9;;
Chris@19 200 Oct) nummonthtod=10;;
Chris@19 201 Nov) nummonthtod=11;;
Chris@19 202 Dec) nummonthtod=12;;
Chris@19 203 esac
Chris@19 204 # For the first six month of the year the time notation can also
Chris@19 205 # be used for files modified in the last year.
Chris@19 206 if (expr $nummonth \> $nummonthtod) > /dev/null;
Chris@19 207 then
Chris@19 208 year=`expr $year - 1`
Chris@19 209 fi;;
Chris@19 210 *) year=$3;;
Chris@19 211 esac
Chris@19 212
Chris@19 213 # The result.
Chris@19 214 echo $day $month $year
Chris@19 215
Chris@19 216 # Local Variables:
Chris@19 217 # mode: shell-script
Chris@19 218 # sh-indentation: 2
Chris@19 219 # eval: (add-hook 'write-file-hooks 'time-stamp)
Chris@19 220 # time-stamp-start: "scriptversion="
Chris@19 221 # time-stamp-format: "%:y-%02m-%02d.%02H"
Chris@19 222 # time-stamp-time-zone: "UTC"
Chris@19 223 # time-stamp-end: "; # UTC"
Chris@19 224 # End: