~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to build-aux/mdate-sh

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
scriptversion=2010-08-21.06; # UTC
5
5
 
6
 
# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009, 2010
7
 
# Free Software Foundation, Inc.
 
6
# Copyright (C) 1995-2012 Free Software Foundation, Inc.
8
7
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
9
8
#
10
9
# This program is free software; you can redistribute it and/or modify
40
39
 
41
40
case $1 in
42
41
  '')
43
 
     echo "$0: No file.  Try \`$0 --help' for more information." 1>&2
 
42
     echo "$0: No file.  Try '$0 --help' for more information." 1>&2
44
43
     exit 1;
45
44
     ;;
46
45
  -h | --h*)
76
75
export LC_TIME
77
76
 
78
77
# GNU ls changes its time format in response to the TIME_STYLE
79
 
# variable.  Since we cannot assume `unset' works, revert this
 
78
# variable.  Since we cannot assume 'unset' works, revert this
80
79
# variable to its documented default.
81
80
if test "${TIME_STYLE+set}" = set; then
82
81
  TIME_STYLE=posix-long-iso
96
95
  ls_command="$ls_command -n"
97
96
fi
98
97
 
99
 
# A `ls -l' line looks as follows on OS/2.
 
98
# A 'ls -l' line looks as follows on OS/2.
100
99
#  drwxrwx---        0 Aug 11  2001 foo
101
100
# This differs from Unix, which adds ownership information.
102
101
#  drwxrwx---   2 root  root      4096 Aug 11  2001 foo
103
102
#
104
103
# To find the date, we split the line on spaces and iterate on words
105
104
# until we find a month.  This cannot work with files whose owner is a
106
 
# user named `Jan', or `Feb', etc.  However, it's unlikely that `/'
 
105
# user named "Jan", or "Feb", etc.  However, it's unlikely that '/'
107
106
# will be owned by a user whose name is a month.  So we first look at
108
107
# the extended ls output of the root directory to decide how many
109
108
# words should be skipped to get the date.
116
115
command=
117
116
until test $month
118
117
do
119
 
  test $# -gt 0 || error "failed parsing \`$ls_command /' output"
 
118
  test $# -gt 0 || error "failed parsing '$ls_command /' output"
120
119
  shift
121
120
  # Add another shift to the command.
122
121
  command="$command shift;"
136
135
  esac
137
136
done
138
137
 
139
 
test -n "$month" || error "failed parsing \`$ls_command /' output"
 
138
test -n "$month" || error "failed parsing '$ls_command /' output"
140
139
 
141
140
# Get the extended ls output of the file or directory.
142
141
set dummy x`eval "$ls_command \"\\\$save_arg1\""`