Last change
on this file since 3335 was 3320, checked in by Bruno Cornec, 10 years ago |
- Re-add (thanks git BTW) the 2.2.9 branch which had been destroyed in
the move to 3.0
|
-
Property svn:executable
set to
*
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | target="$1"
|
---|
4 | loc="$2"
|
---|
5 |
|
---|
6 | test "$target" || exit 1
|
---|
7 | test "$loc" || loc=.
|
---|
8 | test -x "$loc/usage" || exit 1
|
---|
9 | test "$SED" || SED=sed
|
---|
10 | test "$DD" || DD=dd
|
---|
11 |
|
---|
12 | # Some people were bitten by their system lacking a (proper) od
|
---|
13 | od -v -t x1 </dev/null >/dev/null
|
---|
14 | if test $? != 0; then
|
---|
15 | echo 'od tool is not installed or cannot accept "-v -t x1" options'
|
---|
16 | exit 1
|
---|
17 | fi
|
---|
18 |
|
---|
19 | exec >"$target.$$"
|
---|
20 |
|
---|
21 | echo '#define UNPACKED_USAGE "" \'
|
---|
22 | "$loc/usage" | od -v -t x1 \
|
---|
23 | | $SED -e 's/^[^ ]*//' \
|
---|
24 | -e 's/ //g' \
|
---|
25 | -e '/^$/d' \
|
---|
26 | -e 's/\(..\)/\\x\1/g' \
|
---|
27 | -e 's/^/"/' \
|
---|
28 | -e 's/$/" \\/'
|
---|
29 | echo ''
|
---|
30 |
|
---|
31 | echo '#define PACKED_USAGE \'
|
---|
32 | ## Breaks on big-endian systems!
|
---|
33 | ## # Extra effort to avoid using "od -t x1": -t is not available
|
---|
34 | ## # in non-CONFIG_DESKTOPed busybox od
|
---|
35 | ##
|
---|
36 | ## "$loc/usage" | bzip2 -1 | od -v -x \
|
---|
37 | ## | $SED -e 's/^[^ ]*//' \
|
---|
38 | ## -e 's/ //g' \
|
---|
39 | ## -e '/^$/d' \
|
---|
40 | ## -e 's/\(..\)\(..\)/0x\2,0x\1,/g'
|
---|
41 | ## -e 's/$/ \\/'
|
---|
42 | "$loc/usage" | bzip2 -1 | $DD bs=2 skip=1 2>/dev/null | od -v -t x1 \
|
---|
43 | | $SED -e 's/^[^ ]*//' \
|
---|
44 | -e 's/ //g' \
|
---|
45 | -e '/^$/d' \
|
---|
46 | -e 's/\(..\)/0x\1,/g' \
|
---|
47 | -e 's/$/ \\/'
|
---|
48 | echo ''
|
---|
49 |
|
---|
50 | mv -- "$target.$$" "$target"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.