aboutsummaryrefslogtreecommitdiff
path: root/scripts/usage_compressed
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/usage_compressed')
-rwxr-xr-x[-rw-r--r--]scripts/usage_compressed14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/usage_compressed b/scripts/usage_compressed
index 8e2228af2..ab164aa12 100644..100755
--- a/scripts/usage_compressed
+++ b/scripts/usage_compressed
@@ -1,13 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2 2
3loc="$1" 3target="$1"
4loc="$2"
4 5
6test "$target" || exit 1
5test "$loc" || loc=. 7test "$loc" || loc=.
6test -x "$loc/usage" || exit 1 8test -x "$loc/usage" || exit 1
9test "$SED" || SED=sed
10
11sz=`"$loc/usage" | wc -c` || exit 1
12
13exec >"$target"
7 14
8echo 'static const char packed_usage[] = ' 15echo 'static const char packed_usage[] = '
9"$loc"/usage | bzip2 -1 | od -v -t x1 \ 16"$loc/usage" | bzip2 -1 | od -v -t x1 \
10| $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/' || exit 1 17| $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
11echo ';' 18echo ';'
12sz=`"$loc"/usage | wc -c` || exit 1
13echo '#define SIZEOF_usage_messages' `expr 0 + $sz` 19echo '#define SIZEOF_usage_messages' `expr 0 + $sz`