applets/usage_compressed: combine many seds in one; hide dd stats

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Bernhard Reutner-Fischer 2009-10-27 17:05:31 +01:00 committed by Denys Vlasenko
parent 21a542d7d7
commit b35e3a8612

View File

@ -7,6 +7,7 @@ test "$target" || exit 1
test "$loc" || loc=. test "$loc" || loc=.
test -x "$loc/usage" || exit 1 test -x "$loc/usage" || exit 1
test "$SED" || SED=sed test "$SED" || SED=sed
test "$DD" || DD=dd
sz=`"$loc/usage" | wc -c` || exit 1 sz=`"$loc/usage" | wc -c` || exit 1
@ -20,15 +21,15 @@ echo 'static const char packed_usage[] ALIGN1 = {'
## ##
## "$loc/usage" | bzip2 -1 | od -v -x \ ## "$loc/usage" | bzip2 -1 | od -v -x \
## | $SED -e 's/^[^ ]*//' \ ## | $SED -e 's/^[^ ]*//' \
## | $SED -e 's/ //g' \ ## -e 's/ //g' \
## | grep -v '^$' \ ## -e '/^$/d' \
## | $SED -e 's/\(..\)\(..\)/0x\2,0x\1,/g' ## -e 's/\(..\)\(..\)/0x\2,0x\1,/g'
"$loc/usage" | bzip2 -1 | dd bs=2 skip=1 | od -v -t x1 \ "$loc/usage" | bzip2 -1 | $DD bs=2 skip=1 2>/dev/null | od -v -t x1 \
| $SED -e 's/^[^ ]*//' \ | $SED -e 's/^[^ ]*//' \
| $SED -e 's/ //g' \ -e 's/ //g' \
| grep -v '^$' \ -e '/^$/d' \
| $SED -e 's/\(..\)/0x\1,/g' -e 's/\(..\)/0x\1,/g'
echo '};' echo '};'
echo '#define SIZEOF_usage_messages' `expr 0 + $sz` echo '#define SIZEOF_usage_messages' `expr 0 + $sz`