mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
73561cc75a
Various fixes, cleanups and shrinkage: saves 952 Bytes: text data bss dec hex filename 1087742 15853 790632 1894227 1ce753 ../busybox/busybox.old 1086790 15853 790632 1893275 1ce39b busybox via: # scripts/bloat-o-meter ../busybox/busybox_unstripped.old busybox_unstripped function old new delta ipcrm_main 756 822 +66 getval - 61 +61 maybe_set_utc - 40 +40 udhcpc_main 2896 2912 +16 md5_hash_block 428 437 +9 opt 8 16 +8 qgravechar 106 110 +4 make_bitmap 292 295 +3 inflate_unzip 2056 2059 +3 add_partition 1412 1414 +2 __parsespent 156 158 +2 qrealloc 41 42 +1 format - 1 +1 catv_main 313 314 +1 watch_main 293 292 -1 varunset 81 80 -1 part 1 - -1 check_if_skip 837 836 -1 start_stop_daemon_main 840 837 -3 create_lost_and_found 175 172 -3 supress_non_delimited_lines 4 - -4 static.l 4 - -4 static.c 5 1 -4 bsd_sum_file 237 233 -4 eval2 338 332 -6 arithmetic_common 166 158 -8 cmpfunc 22 5 -17 cksum_main 294 275 -19 cmp_main 465 439 -26 dd_main 1535 1508 -27 rmmod_main 376 333 -43 cut_file 727 644 -83 ipcs_main 3809 3721 -88 cut_main 722 614 -108 date_main 1443 1263 -180 remove_ids 222 - -222 ------------------------------------------------------------------------------ (add/remove: 3/4 grow/shrink: 11/18 up/down: 217/-853) Total: -636 bytes
79 lines
2.1 KiB
Bash
Executable File
79 lines
2.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Tests for the sourcecode base itself.
|
|
# Copyright 2006 by Mike Frysinger <vapier@gentoo.org>
|
|
# Licensed under GPL v2, see file LICENSE for details.
|
|
|
|
[ -n "$srcdir" ] || srcdir=$(pwd)
|
|
. testing.sh
|
|
|
|
|
|
#
|
|
# if we don't have the sourcecode available, let's just bail
|
|
#
|
|
[ -s "$srcdir/../Makefile" ] || exit 0
|
|
[ -s "$srcdir/../include/applets.h" ] || exit 0
|
|
|
|
|
|
#
|
|
# verify the applet order is correct in applets.h, otherwise
|
|
# applets won't be called properly.
|
|
#
|
|
sed -n -e '/^USE_[A-Z]*(APPLET(/{s:.*(::;s:,.*::;s:"::g;p}' \
|
|
$srcdir/../include/applets.h > applet.order.current
|
|
LC_ALL=C sort applet.order.current > applet.order.correct
|
|
testing "Applet order" "diff -u applet.order.current applet.order.correct" "" "" ""
|
|
rm -f applet.order.current applet.order.correct
|
|
|
|
|
|
#
|
|
# check for misc common typos
|
|
#
|
|
find $srcdir/../ \
|
|
'(' -type d -a '(' -name .svn -o -name testsuite ')' -prune ')' \
|
|
-o '(' -type f -a -print0 ')' | xargs -0 \
|
|
grep -I \
|
|
-e '\<compatability\>' \
|
|
-e '\<compatable\>' \
|
|
-e '\<fordeground\>' \
|
|
-e '\<depency\>' -e '\<dependancy\>' -e '\<dependancies\>' \
|
|
-e '\<defalt\>' \
|
|
-e '\<remaing\>' \
|
|
-e '\<queueing\>' \
|
|
-e '\<detatch\>' \
|
|
-e '\<sempahore\>' \
|
|
-e '\<reprenstative\>' \
|
|
-e '\<overriden\>' \
|
|
-e '\<readed\>' \
|
|
-e '\<formated\>' \
|
|
-e '\<algorithic\>' \
|
|
-e '\<deamon\>' \
|
|
-e '\<derefernce\>' \
|
|
-e '\<acomadate\>' \
|
|
| sed -e "s:^$srcdir/\.\./::g" > src.typos
|
|
testing "Common typos" "cat src.typos" "" "" ""
|
|
rm -f src.typos
|
|
|
|
|
|
#
|
|
# don't allow obsolete functions
|
|
#
|
|
find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \
|
|
grep -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utimes)\>[[:space:]]*\(' \
|
|
| sed -e "s:^$srcdir/\.\./::g" > src.obsolete.funcs
|
|
testing "Obsolete function usage" "cat src.obsolete.funcs" "" "" ""
|
|
rm -f src.obsolete.funcs
|
|
|
|
|
|
#
|
|
# don't allow obsolete headers
|
|
#
|
|
find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \
|
|
grep -E -e '\<(malloc|memory|sys/(errno|fcntl|signal|stropts|termios|unistd))\.h\>' \
|
|
| sed -e "s:^$srcdir/\.\./::g" > src.obsolete.headers
|
|
testing "Obsolete headers" "cat src.obsolete.headers" "" "" ""
|
|
rm -f src.obsolete.headers
|
|
|
|
|
|
exit $FAILCOUNT
|