Skip to contentSkip to conversation

time locale in gen_initramfs_list.sh

PATCH In review Florian Fainelli 5 participants 6 messages May 8, 2007 – May 10, 2007 Kbuild

lore
Share & tools
lore
#0 lore raw

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
index 683eb12..1f96b9b 100644
@@ -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}"
 			;;
 		*)
#1 lore raw
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

#2 lore raw

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
---------------------------------------------
#3 lore raw
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

#4 lore raw
In reply to Florian Fainelli
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.

--

[time_locale.patch text/plain (761B)]

scripts/gen_initramfs_list.sh +1 -1
index 683eb12..1f96b9b 100644
@@ -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 ;)

#5 lore raw
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