The less patch is in.

Dirk Clemens develop at cle-mens.de
Sat Sep 17 16:47:01 UTC 2005


Paul Fox wrote:

> > Sorry about the error in my patch - I thought I'd put less in the
> > right place in terms of alphabetical order, somehow.
> > I'd be happy to write the Perl script, if as recompense for my patch
> > if nothing else. I'll probably be able to submit it together with the
> > cleanup patch, as neither appears to be too complex.
>
> please don't use perl. it's a good idea, but how about something
> like this:
>
> get_applets()
> {
> sed < include/applets.h \
> -n -e 's/^[[:space:]]*APPLET(\([^,]*\),.*)[[:space:]]*/\1/p'
> }
>
> appletlist=$(get_applets)
> sortedlist=$(get_applets | sort)
>
> if [ "$appletlist" != "$sortedlist" ]
> then
> echo applets not in alphabetical order
> exit 1
> fi

or with more diagnostics:

if [ "$appletlist" != "$sortedlist" ]
then
   echo "applets not in alphabetical order:"
   get_applets > applets_list.tmp
   sort applets_list.tmp | diff -u applets_list.tmp - | sed 's/^/   /'
   rm -f applets_list.tmp
   exit 1
fi

Dirk



More information about the busybox mailing list