Desktop drive icon size display fixed

Bm has been reporting for ages that the desktop drive icons display their sizes as 0 bytes. He has a Belgian keyboard and nl_BE@euro locale.

Bm sent me a pm that gave me a hint where to look for the cause of the problem. I tracked it down. It has nothing to do with keyboard layout, only the locale setting.

The problem is that nl_BE uses a comma ',' in numerical values instead of a "normal" decimal point '.'.

The script /sbin/pup_event_frontend_d has "export LANG=C" at the beginning, which my testing showed made the script run faster. However, when the 'dc' application is executed it outputs the normal decimal point, which when fed to the Busybox 'printf' causes an error.

This is actually quite strange, as the 'printf' applet should read the exported LANG=C and accept the '.' decimal point.

Anyway, I fixed it by exporting the correct locale just for those two:

SIZE="`LANG=$OLDLANG dc $SIZE 1024 \/ p`" #100613
SIZE="`LANG=$OLDLANG printf "%.1f" $SIZE`MB" #100613



Posted on 13 Jun 2010, 18:57


Comments:

Posted on 13 Jun 2010, 24:04 by ecube
Typo in shebang
Hmmmm!

In my puppy installations the problem was solved by
correcting a typo in the shebang of

/sbin/pup_event_frontend_d

/binin/ash should be #!/bin/bash


Posted on 14 Jun 2010, 2:33 by drongo
commas
Many mainland (i.e. not British) Europeans use commas for decimal places and spaces to replace commas in numbers. I think decimal points with full-stops are only "normal" in English-speaking countries such as UK, USA, Canada, Australia, NZ, etc.

So this may affect a lot of European keyboard/locale combinations.


Posted on 14 Jun 2010, 3:01 by technosaurus
ash not a typo
ash is the busybox alternative for bash and is typically much faster. It may alternatively be fixed with an updated busybox.

Recent static uclibc versions of binaries are here:
http://busybox.net/downloads/binaries/

There are some new applets available too:
unxz, fg_console, bootchartd, rfkill, flock, lsusb, lspci, traceroute6, ntpd, flashcp, mkfs.reiser, wall, tune2fs, mkfs_ext2, beep, volname, fsync, flash_lock, flash_unlock, scriptreplay, lzop, ifplugd, mkdosfs, ftpd, ionice, tunctl, mkpasswd, acpid, timeout, sha256,
sha512


Posted on 14 Jun 2010, 10:41 by aarf
comas
" full-stops are only "normal" in English-speaking countries such as UK, USA, Canada, Australia, NZ, etc."
wrong
more accurate would be: commas are used in some european language speaking countries. full stop is easily the majority world wide.
.....
if you are tracking down mouse over errors there is still the interchange of the - and + signs in the timezone mouse over.
and the battery app mouseover in some puppies needs a look too. these affects are seen by everyone not just one language specific section.


Posted on 14 Jun 2010, 14:07 by drongo
commas
OK, I'll give you India and China, but that isn't really the point is it? It's not a vote. If I'm French or German I'll be wanting to use a comma, it doesn't really matter to me if three billion people are using a full-stop does it?


Posted on 15 Jun 2010, 8:46 by shinobar
LC_NUMERIC
Which decimal point is controlled by LC_NUMERIC, maybe not by LANG.
The solution is 'export LC_NUMERIC=C' or 'export LC_ALL=C' before printf.


Posted on 15 Jun 2010, 8:02 by shinobar
LC_NUMERIC
Which decimal point is controlled by LC_NUMERIC, maybe not by LANG.
The solution is 'export LC_NUMERIC=C' or 'export LC_ALL=C' before printf.

They should be restore when launching pmount at line 711. Such as:
LANG=$OLDLANG LC_ALL= pmount


Posted on 16 Jun 2010, 2:35 by eden6000
Good catch shinobar!
Your trick worked for me shinobar! my puppy is set for it_IT@euro and now desktop drive icons show regularly their size! Thanks!