diff --git a/src/modules/_Crypto/.build_lobotomized_crypto b/src/modules/_Crypto/.build_lobotomized_crypto index 0e10fbccf8757a93cf70d6792d95dae7ec423d1e..9e06af93c4882663f5cebdacaaee3b5594fe25e7 100755 --- a/src/modules/_Crypto/.build_lobotomized_crypto +++ b/src/modules/_Crypto/.build_lobotomized_crypto @@ -12,11 +12,22 @@ mkdir -p ../_Lobotomized_Crypto mkdir -p ../_Lobotomized_Crypto/include mkdir -p ../_Lobotomized_Crypto/lib +# +# This way we avoid re-building things which have not changed. +# +function smartcopy() { + if test -f "$1" -a -f "$2" && cmp "$1" "$2" 1>/dev/null 2>/dev/null; then + : + else + cp "$1" "$2" + fi +} + echo "Copying source files..." for d in . include lib; do for f in `cat $d/.exportable_files`; do - echo $d/$f - cp $d/$f ../_Lobotomized_Crypto/$d/$f + echo $d/$f + smartcopy $d/$f ../_Lobotomized_Crypto/$d/$f done done @@ -24,6 +35,8 @@ echo "Censoring sensitive files" for f in crypto.c Makefile.in lib/Makefile.in testsuite.in ; do echo $f sed '/BEGIN NATIONAL SECURITY/,/END NATIONAL SECURITY/d' \ - < $f > ../_Lobotomized_Crypto/$f + < $f > .temporary_file + smartcopy .temporary_file ../_Lobotomized_Crypto/$f done +rm .temporary_file diff --git a/src/modules/_Crypto/testsuite.in b/src/modules/_Crypto/testsuite.in index 78579e7a5adde6b5cbe94b47ccaf8b42ef966a3f..ee682336c27187d9f61f38c7cbf79ed3ca27ee61 100644 --- a/src/modules/_Crypto/testsuite.in +++ b/src/modules/_Crypto/testsuite.in @@ -1,6 +1,15 @@ // Crypto test_true([[objectp(Crypto)]]) +// BEGIN NATIONAL SECURITY +define(AVOID,[[]]) +AVOID([[ +// END NATIONAL SECURITY +test_do(add_constant("Crypto",master()->resolv("_Lobotomized_Crypto"))) +// BEGIN NATIONAL SECURITY +]]) +// END NATIONAL SECURITY + // C-programs test_true([[programp(Crypto.cbc)]]) test_true([[programp(Crypto.crypto)]])