diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bb_release | 6 | ||||
-rw-r--r-- | scripts/echo.c | 35 | ||||
-rwxr-xr-x | scripts/embedded_scripts | 6 | ||||
-rwxr-xr-x | scripts/mkconfigs | 11 |
4 files changed, 41 insertions, 17 deletions
diff --git a/scripts/bb_release b/scripts/bb_release index 545440d3a..180ad8f2e 100755 --- a/scripts/bb_release +++ b/scripts/bb_release | |||
@@ -17,7 +17,7 @@ VERSION=`ls busybox-*.tar.gz | sed 's/busybox-\(.*\)\.tar\.gz/\1/'` | |||
17 | zcat busybox-$VERSION.tar.gz | bzip2 > busybox-$VERSION.tar.bz2 | 17 | zcat busybox-$VERSION.tar.gz | bzip2 > busybox-$VERSION.tar.bz2 |
18 | 18 | ||
19 | for releasefile in busybox-$VERSION.tar.gz busybox-$VERSION.tar.bz2; do | 19 | for releasefile in busybox-$VERSION.tar.gz busybox-$VERSION.tar.bz2; do |
20 | test -f $releasefile || { echo "no $releasefile"; exit 1; } | 20 | test -f $releasefile || { echo "no $releasefile"; exit 1; } |
21 | gpg --detach-sign $releasefile | 21 | gpg --detach-sign $releasefile |
22 | sha256sum $releasefile > $releasefile.sha256 | 22 | sha256sum $releasefile > $releasefile.sha256 |
23 | done | 23 | done |
diff --git a/scripts/echo.c b/scripts/echo.c index 7474ccdd4..e3a07adf0 100644 --- a/scripts/echo.c +++ b/scripts/echo.c | |||
@@ -153,25 +153,32 @@ int main(int argc, char **argv) | |||
153 | if (!eflag) { | 153 | if (!eflag) { |
154 | /* optimization for very common case */ | 154 | /* optimization for very common case */ |
155 | fputs(arg, stdout); | 155 | fputs(arg, stdout); |
156 | } else while ((c = *arg++)) { | 156 | } else |
157 | if (c == eflag) { /* Check for escape seq. */ | 157 | while ((c = *arg++) != '\0') { |
158 | if (c == eflag) { | ||
159 | /* This is an "\x" sequence */ | ||
160 | |||
158 | if (*arg == 'c') { | 161 | if (*arg == 'c') { |
159 | /* '\c' means cancel newline and | 162 | /* "\c" means cancel newline and |
160 | * ignore all subsequent chars. */ | 163 | * ignore all subsequent chars. */ |
161 | goto ret; | 164 | goto ret; |
162 | } | 165 | } |
163 | { | 166 | /* Since SUSv3 mandates a first digit of 0, 4-digit octals |
164 | /* Since SUSv3 mandates a first digit of 0, 4-digit octals | 167 | * of the form \0### are accepted. */ |
165 | * of the form \0### are accepted. */ | 168 | if (*arg == '0') { |
166 | if (*arg == '0') { | 169 | if ((unsigned char)(arg[1] - '0') < 8) { |
167 | /* NB: don't turn "...\0" into "...\" */ | 170 | /* 2nd char is 0..7: skip leading '0' */ |
168 | if (arg[1] && ((unsigned char)(arg[1]) - '0') < 8) { | 171 | arg++; |
169 | arg++; | ||
170 | } | ||
171 | } | 172 | } |
172 | /* bb_process_escape_sequence handles NUL correctly | 173 | } |
173 | * ("...\" case. */ | 174 | /* bb_process_escape_sequence handles NUL correctly |
174 | c = bb_process_escape_sequence(&arg); | 175 | * ("...\" case). */ |
176 | { | ||
177 | /* optimization: don't force arg to be on-stack, | ||
178 | * use another variable for that. ~30 bytes win */ | ||
179 | const char *z = arg; | ||
180 | c = bb_process_escape_sequence(&z); | ||
181 | arg = z; | ||
175 | } | 182 | } |
176 | } | 183 | } |
177 | putchar(c); | 184 | putchar(c); |
diff --git a/scripts/embedded_scripts b/scripts/embedded_scripts index aa7bf3e8a..205ac591a 100755 --- a/scripts/embedded_scripts +++ b/scripts/embedded_scripts | |||
@@ -23,6 +23,12 @@ if test $? != 0; then | |||
23 | exit 1 | 23 | exit 1 |
24 | fi | 24 | fi |
25 | 25 | ||
26 | bzip2 </dev/null >/dev/null | ||
27 | if test $? != 0; then | ||
28 | echo 'bzip2 is not installed' | ||
29 | exit 1 | ||
30 | fi | ||
31 | |||
26 | custom_scripts="" | 32 | custom_scripts="" |
27 | if [ -d "$custom_loc" ] | 33 | if [ -d "$custom_loc" ] |
28 | then | 34 | then |
diff --git a/scripts/mkconfigs b/scripts/mkconfigs index 6a26fe1dd..1bbf10c3a 100755 --- a/scripts/mkconfigs +++ b/scripts/mkconfigs | |||
@@ -28,6 +28,17 @@ | |||
28 | 28 | ||
29 | config=.config | 29 | config=.config |
30 | 30 | ||
31 | od -v -b </dev/null >/dev/null | ||
32 | if test $? != 0; then | ||
33 | echo 'od tool is not installed or cannot accept "-v -b" options' | ||
34 | exit 1 | ||
35 | fi | ||
36 | bzip2 </dev/null >/dev/null | ||
37 | if test $? != 0; then | ||
38 | echo 'bzip2 is not installed' | ||
39 | exit 1 | ||
40 | fi | ||
41 | |||
31 | { | 42 | { |
32 | echo "\ | 43 | echo "\ |
33 | #ifndef _BBCONFIGOPTS_H | 44 | #ifndef _BBCONFIGOPTS_H |