BUG with usage_compressed (?)

Paul Fox pgf at brightstareng.com
Mon Jun 12 23:29:12 UTC 2006


bernhard wrote:
 > Houston...,
 > 
 > The usage-messages are foobared (for me):
 > This should print the helptext of sort, but it displays the one
 > of start-stop-daemon:
 > 
 > $ ./busybox sort -h
 > sort: invalid option -- h
 > BusyBox v1.2.0-pre0 (2006.05.30-16:12+0000) multi-call binary
 > 
 > Usage: sort [OPTIONS] [--start|--stop] ... [-- arguments...]


i just happened to reproduce this, and spent some time debugging it.

it's a dependency problem.

when i had the problem, i had catv configured, but the catv usage
was entirely missing from the compressed usage strings.  all applets
"above" catv gave correct usage, all applets "below" catv gave
incorrect usage.  i followed things back, and eventually, when i
did "touch scripts/usage.c", causing it to be rebuilt, the
problem went away.

the "scripts/usage" command is what builds usage_compressed.h.  it
needs to be rebuilt (i.e. scripts/usage.c must be recompiled) anytime
usage.h, applets.h, or any of their dependencies changes.

perhaps it's as simple as this?  (untested)

Index: Makefile
===================================================================
--- Makefile    (revision 15346)
+++ Makefile    (working copy)
@@ -438,7 +438,7 @@
 
 ifeq ($(strip $(CONFIG_FEATURE_COMPRESS_USAGE)),y)
 USAGE_BIN:=scripts/usage
-$(USAGE_BIN): $(top_srcdir)/scripts/usage.c
+$(USAGE_BIN): $(top_srcdir)/scripts/usage.c .config
        $(do_link.h)
 
 DEP_INCLUDES += include/usage_compressed.h


paul
=---------------------
 paul fox, pgf at brightstareng.com



More information about the busybox mailing list