No subject


Thu Oct 23 17:17:48 UTC 2008


neil at nm-tyan:~$ uname -a
Linux nm-tyan 2.6.22-14-generic http://busybox.net/bugs/view.php?id=1 SMP Tue
Feb 12 07:42:25 UTC 2008 i686
GNU/Linux
neil at nm-tyan:~$ which sort
/usr/bin/sort
neil at nm-tyan:~$ for n in 1 2; do echo sort $n; sort -n -k$n foo;done
sort 1
AAAAAA 1
BBBBBB 4
CCCCCC 2
DDDDDD 6
sort 2
AAAAAA 1
CCCCCC 2
BBBBBB 4
DDDDDD 6

ACTUAL OUTCOME:

busybox only ever sorts on the first field even when instructed to sort on
the
second, third etc. field. Consequently the following list is NOT
correctly
sorted on the second field:

busybox 2
AAAAAA 1
BBBBBB 4
CCCCCC 2
DDDDDD 6


http://bugs.busybox.net/view.php?id=1144 implies that the fix should have
gone to Busybox v1.7 or v1.8.  However, when I tested with Busybox
1.10 in Maemo Fremantle, it still exhibited this issue.

And when testing this more, none of:
- using letters (and no -n) instead of numbers,
- putting the letter to second char column, or
- using TAB instead of space
helps.  Busybox sort -k option doesn't do anything. Etch Busybox v1.1.3
worked
fine.

Then I started to look into Busybox 1.10 sources. In our version
CONFIG_FEATURE_SORT_BIG isn't currently enabled.  *Keys and -k work only
if
it's enabled*.

This is the most annoying thing in Busybox.  If you configure out
features, it
doesn't disable the corresponding command line options, it just silently
ignores them (in "ps" case, it ignores all options).  This means that when
e.g.
building software using BB, Busybox can just silently corrupt the
generated
data; when installing software, installation scripts that given Busybox
configuration breaks, don't fail as they should etc.
====================================================================== 

---------------------------------------------------------------------- 
 vda - 10-27-08 05:14  
---------------------------------------------------------------------- 
Works in current svn:

# for n in 1 2; do echo ./busybox $n; ./busybox sort -n -k$n foo; done
./busybox 1
AAAAAA 1
BBBBBB 4
CCCCCC 2
DDDDDD 6
./busybox 2
AAAAAA 1
CCCCCC 2
BBBBBB 4
DDDDDD 6

GNU sort does exactly the same:

# for n in 1 2; do echo $n; sort -n -k$n foo; done
1
AAAAAA 1
BBBBBB 4
CCCCCC 2
DDDDDD 6
2
AAAAAA 1
CCCCCC 2
BBBBBB 4
DDDDDD 6


> Then I started to look into Busybox 1.10 sources. In our version
> CONFIG_FEATURE_SORT_BIG isn't currently enabled. *Keys and -k work
> only if it's enabled*.

D'oh. You disabled the feature and then complain that it doesn't work.

>This is the most annoying thing in Busybox. If you configure out
features,
>it doesn't disable the corresponding command line options,
>it just silently ignores them (in "ps" case, it ignores all options).

The opposite behavior would just annoy different group of people, which
prefers utilities to ignore some switches instead of bombing out. umount
ignores -v (verbose) switch. Do you want it to die instead? How is that
useful?

> This means that when e.g. building software using BB, Busybox can just
> silently corrupt the generated data

D'oh again. If you plan to build software on the machine you install
busybox on, you'd better enable most of the options, since you want
maximum compatibility. Disabling options implies that you know that in
this particular installation it's ok. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-27-08 04:42  Andre Klapper  New Issue                                    
10-27-08 04:42  Andre Klapper  Status                   new => assigned     
10-27-08 04:42  Andre Klapper  Assigned To               => BusyBox         
10-27-08 05:14  vda            Note Added: 0014284                          
======================================================================



More information about the busybox-cvs mailing list