busybox/scripts/usage_compressed

20 lines
400 B
Plaintext
Raw Normal View History

#!/bin/sh
2006-10-05 15:47:08 +05:30
target="$1"
loc="$2"
2006-10-05 15:47:08 +05:30
test "$target" || exit 1
test "$loc" || loc=.
test -x "$loc/usage" || exit 1
2006-10-05 15:47:08 +05:30
test "$SED" || SED=sed
sz=`"$loc/usage" | wc -c` || exit 1
exec >"$target"
echo 'static const char packed_usage[] = '
2006-10-05 15:47:08 +05:30
"$loc/usage" | bzip2 -1 | od -v -t x1 \
| $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
echo ';'
echo '#define SIZEOF_usage_messages' `expr 0 + $sz`