Changeset 1964 for cpio/vendor/current/build-aux/mdate-sh
- Timestamp:
- Feb 3, 2017, 2:02:34 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified cpio/vendor/current/build-aux/mdate-sh ¶
r118 r1964 2 2 # Get modification time of a file or directory and pretty-print it. 3 3 4 scriptversion=2010-02-22.21; # UTC 5 6 # Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009, 2010 7 # Free Software Foundation, Inc. 4 scriptversion=2010-08-21.06; # UTC 5 6 # Copyright (C) 1995-2015 Free Software Foundation, Inc. 8 7 # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995 9 8 # … … 30 29 # <automake-patches@gnu.org>. 31 30 31 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 32 emulate sh 33 NULLCMD=: 34 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which 35 # is contrary to our usage. Disable this feature. 36 alias -g '${1+"$@"}'='"$@"' 37 setopt NO_GLOB_SUBST 38 fi 39 32 40 case $1 in 33 41 '') 34 echo "$0: No file. Try \`$0 --help' for more information." 1>&242 echo "$0: No file. Try '$0 --help' for more information." 1>&2 35 43 exit 1; 36 44 ;; … … 52 60 esac 53 61 62 error () 63 { 64 echo "$0: $1" >&2 65 exit 1 66 } 67 68 54 69 # Prevent date giving response in another language. 55 70 LANG=C … … 61 76 62 77 # GNU ls changes its time format in response to the TIME_STYLE 63 # variable. Since we cannot assume `unset' works, revert this78 # variable. Since we cannot assume 'unset' works, revert this 64 79 # variable to its documented default. 65 80 if test "${TIME_STYLE+set}" = set; then … … 81 96 fi 82 97 83 # A `ls -l' line looks as follows on OS/2.98 # A 'ls -l' line looks as follows on OS/2. 84 99 # drwxrwx--- 0 Aug 11 2001 foo 85 100 # This differs from Unix, which adds ownership information. … … 88 103 # To find the date, we split the line on spaces and iterate on words 89 104 # until we find a month. This cannot work with files whose owner is a 90 # user named `Jan', or `Feb', etc. However, it's unlikely that `/'105 # user named "Jan", or "Feb", etc. However, it's unlikely that '/' 91 106 # will be owned by a user whose name is a month. So we first look at 92 107 # the extended ls output of the root directory to decide how many … … 101 116 until test $month 102 117 do 118 test $# -gt 0 || error "failed parsing '$ls_command /' output" 103 119 shift 104 120 # Add another shift to the command. … … 120 136 done 121 137 138 test -n "$month" || error "failed parsing '$ls_command /' output" 139 122 140 # Get the extended ls output of the file or directory. 123 set dummy x`eval "$ls_command \"\ $save_arg1\""`141 set dummy x`eval "$ls_command \"\\\$save_arg1\""` 124 142 125 143 # Remove all preceding arguments
Note:
See TracChangeset
for help on using the changeset viewer.