time locale in gen_initramfs_list.sh
PATCH 1/1 time locale in gen_initramfs_list.sh
I noticed that some zsh users who forced their ls formatting to something non standard could not generate the initramfs file list. Forcing the locale to C while generating seems not to be enough. Adding --time-style=locale will use C locale ls output and will let them generate the initramfs list. It has no side effects for other users.
--
scripts/gen_initramfs_list.sh +2 -2
@@ -125,7 +125,7 @@ parse() { str="${ftype} ${name} ${location} ${str}" ;; "nod") - local dev=`LC_ALL=C ls -l "${location}"` + local dev=`LC_ALL=C ls --time-style=locale -l "${location}"` local maj=`field 5 ${dev}` local min=`field 6 ${dev}` maj=${maj%,}
@@ -135,7 +135,7 @@ parse() { str="${ftype} ${name} ${str} ${dev} ${maj} ${min}" ;; "slink") - local target=`field 11 $(LC_ALL=C ls -l "${location}")` + local target=`field 11 $(LC_ALL=C ls --time-style=locale -l "${location}")` str="${ftype} ${name} ${target} ${str}" ;; *)
Quoted 5 lines · Florian Fainelli
I noticed that some zsh users who forced their ls formatting to something non standard could not generate the initramfs file list. Forcing the locale to C while generating seems not to be enough. Adding --time-style=locale will use C locale ls output and will let them generate the initramfs list. It has no side effects for other users.
... except for those whose "ls" doesn't have "--time-style=locale"; how long has that been implemented?
-hpa
Hello Peter,
This is true. According to GNU fileutils changelog, the nearest Changelog message regarding this option is :
2004-11-19 Alfred M. Szmidt <[email protected]>
* src/ls.c (usage): Clarified description of --no-group (-G),
--human-readable (-h), --inode (-i), --size (-s), --time,
and --time-style.Le mardi 8 mai 2007, H. Peter Anvin a écrit :
Quoted 11 lines
Quoted 5 lines · Florian Fainelli
I noticed that some zsh users who forced their ls formatting to something non standard could not generate the initramfs file list. Forcing the locale to C while generating seems not to be enough. Adding --time-style=locale will use C locale ls output and will let them generate the initramfs list. It has no side effects for other users.
... except for those whose "ls" doesn't have "--time-style=locale"; how long has that been implemented?
-hpa
Signature · 2 lines
Cordialement, Florian Fainelli ---------------------------------------------
Quoted 8 lines · Florian Fainelli
This is true. According to GNU fileutils changelog, the nearest Changelog message regarding this option is :
2004-11-19 Alfred M. Szmidt <[email protected]>
* src/ls.c (usage): Clarified description of --no-group (-G), --human-readable (-h), --inode (-i), --size (-s), --time, and --time-style.
It's also possible to overwrite that TIME_STYLE variable (which is responsible for the format change), like so
LC_ALL=C TIME_STYLE=locale ls -l ...
Regards...
Michael
Quoted 25 lines · On Tue, 8 May 2007 07:55:26 +0200 Florian Fainelli…
I noticed that some zsh users who forced their ls formatting to something non standard could not generate the initramfs file list. Forcing the locale to C while generating seems not to be enough. Adding --time-style=locale will use C locale ls output and will let them generate the initramfs list. It has no side effects for other users.
Signed-off-by Florian Fainelli <[email protected]>--
[time_locale.patch text/plain (761B)]
scripts/gen_initramfs_list.sh +1
-1@@ -125,7 +125,7 @@ parse() { str="${ftype} ${name} ${location} ${str}" ;; "nod") - local dev=`LC_ALL=C ls -l "${location}"` + local dev=`LC_ALL=C ls --time-style=locale -l "${location}"` local maj=`field 5 ${dev}` local min=`field 6 ${dev}` maj=${maj%,}
scripts/gen_initramfs_list.sh parse() { · line 140
Quoted 7 lines
scripts/gen_initramfs_list.sh +1
-1@@ -135,7 +135,7 @@ parse() { str="${ftype} ${name} ${str} ${dev} ${maj} ${min}" ;; "slink") - local target=`field 11 $(LC_ALL=C ls -l "${location}")` + local target=`field 11 $(LC_ALL=C ls --time-style=locale -l "${location}")` str="${ftype} ${name} ${target} ${str}" ;;
hm, --time-style sounds rather gnu-specific and perhaps we'd rather not add that requirement. Or perhaps we already require gnu ls, dunno.
I'll dump the problem in Sam's lap ;)
Quoted 2 lines · Andrew Morton
hm, --time-style sounds rather gnu-specific and perhaps we'd rather not add that requirement. Or perhaps we already require gnu ls, dunno.
Running this sort of thing with busybox instead of the gnu tools is why I sent the gawk/awk patches earlier. If a requirement for gnu ls has snuck in, it's been within the last few months.
Rob