~hamo/ubuntu/precise/grub2/grub2.hi_res

« back to all changes in this revision

Viewing changes to build-aux/mdate-sh

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, Colin Watson, Evan Broder, Mario Limonciello
  • Date: 2010-11-24 13:59:55 UTC
  • mfrom: (1.17.6 upstream) (17.6.15 experimental)
  • Revision ID: james.westby@ubuntu.com-20101124135955-r6ii5sepayr7jt53
Tags: 1.99~20101124-1ubuntu1
[ Colin Watson ]
* Resynchronise with Debian experimental.  Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
    recovery mode, quiet option, tweak how memtest86+ is displayed, and
    use UUIDs where appropriate.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel= options if kdump and makedumpfile are available.
  - If other operating systems are installed, then automatically unhide
    the menu.  Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
    if available to check whether Shift is pressed.  If it is, show the
    menu, otherwise boot immediately.  If keystatus is not available, then
    fall back to a short delay interruptible with Escape.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Don't display introductory message about line editing unless we're
    actually offering a shell prompt.  Don't clear the screen just before
    booting if we never drew the menu in the first place.
  - Remove some verbose messages printed before reading the configuration
    file.
  - Suppress progress messages as the kernel and initrd load for
    non-recovery kernel menu entries.
  - Change prepare_grub_to_access_device to handle filesystems
    loop-mounted on file images.
  - Ignore devices loop-mounted from files in 10_linux.
  - Show the boot menu if the previous boot failed, that is if it failed
    to get to the end of one of the normal runlevels.
  - Don't generate /boot/grub/device.map during grub-install or
    grub-mkconfig by default.
  - Adjust upgrade version checks for Ubuntu.
  - Don't display "GRUB loading" unless Shift is held down.
  - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate
    our backport of the grub-doc split.
  - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
  - Look for .mo files in /usr/share/locale-langpack as well, in
    preference.
  - Make sure GRUB_TIMEOUT isn't quoted unnecessarily.
  - Probe all devices in 'grub-probe --target=drive' if
    /boot/grub/device.map is missing.
  - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
  - Use qemu rather than qemu-system-i386.
  - Program vesafb on BIOS systems rather than efifb.
  - Add a grub-rescue-efi-amd64 package containing a rescue CD-ROM image
    for EFI-AMD64.
  - On Wubi, don't ask for an install device, but just update wubildr
    using the diverted grub-install.
  - When embedding the core image in a post-MBR gap, check for and avoid
    sectors matching any of a list of known signatures.
  - Disable video_bochs and video_cirrus on PC BIOS systems, as probing
    PCI space seems to break on some systems.
* Downgrade "ACPI shutdown failed" error to a debug message, since it can
  cause spurious test failures.

[ Evan Broder ]
* Enable lua from grub-extras.
* Incorporate the bitop library into lua.
* Add enum_pci function to grub module in lua.
* Switch back to gfxpayload=keep by default, unless the video hardware
  is known to not support it.

[ Mario Limonciello ]
* Built part_msdos and vfat into bootx64.efi (LP: #677758)

Show diffs side-by-side

added added

removed removed

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