From f7d945f4eb287a6030e6a590f15513d38b345fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 3 Apr 2015 15:21:50 +0200 Subject: [PATCH] Handle remaining corner-cases --- tmp/analyze-names.sh | 2 +- tmp/invoke-rename.sh | 26 +++++++++++++++++++++++--- tmp/rename.pl | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/tmp/analyze-names.sh b/tmp/analyze-names.sh index 042f3eb46..36422ab54 100755 --- a/tmp/analyze-names.sh +++ b/tmp/analyze-names.sh @@ -34,7 +34,7 @@ wc -l public-names NL=' ' sed -n 's/POLARSSL_[A-Z0-9_]*/\'"$NL"'&\'"$NL"/gp \ - include/mbedtls/*.h tests/scripts/* scripts/* library/*.c \ + include/mbedtls/*.h tests/scripts/* scripts/* library/*.c configs/*.h \ | grep POLARSSL | sort -u > _POLARSSL_XXX diff public-names _POLARSSL_XXX | sed -n 's/^> //p' > extra-names rm _POLARSSL_XXX diff --git a/tmp/invoke-rename.sh b/tmp/invoke-rename.sh index d27ba876d..f1ba618b6 100755 --- a/tmp/invoke-rename.sh +++ b/tmp/invoke-rename.sh @@ -2,12 +2,32 @@ # test result with: # make all check -# ggrep -i --exclude-dir=mpg --exclude=.travis.yml --exclude=ChangeLog --exclude=extra-names --exclude=public-names polarssl . --exclude-dir=tmp G -v 'OU?=PolarSSL|PolarSSLTes' | cut -d':' -f1 | sort -u set -eu tmp/analyze-names.sh tmp/makelist.pl public-names extra-names > old2new -tmp/rename.pl old2new include/mbedtls/*.h library/*.c tests/suites/* configs/*.h scripts/data_files/*.fmt scripts/* tests/scripts/* -tmp/rename.pl old2new programs/*.c programs/*/*.c +tmp/rename.pl old2new library/*.c tests/suites/* tests/ssl-opt.sh \ + configs/* scripts/data_files/*.fmt +tmp/rename.pl -s old2new library/error.c library/version_features.c \ + library/memory_buffer_alloc.c include/mbedtls/*.h \ + library/ecp.c \ + programs/*.c programs/*/*.c scripts/* tests/scripts/* + +for i in scripts/generate_errors.pl scripts/memory.sh tests/compat.sh \ + tests/suites/test_suite_version.data configs/README.txt +do + sed -e 's/POLARSSL/MBEDTLS/g' -e 's/polarssl/mbedtls/g' < $i > $i.tmp + mv $i.tmp $i +done +chmod +x scripts/generate_errors.pl scripts/memory.sh tests/compat.sh + +echo; echo 'Done. Remaining polarssl occurences:' +rm -f enum-consts exported-symbols extra-names identifiers macros old2new \ + prefix-enum-consts prefix-identifiers prefix-macros public-names \ + tags cscope* +grep -R --exclude-dir=.git --exclude-dir=mpg --exclude-dir=tmp \ + --exclude=.travis.yml --exclude=ChangeLog \ + -i polarssl . \ + | egrep -v 'OU?=PolarSSL|"PolarSSL|polarssl\.example' || true diff --git a/tmp/rename.pl b/tmp/rename.pl index 6fa22b379..4d1854c5d 100755 --- a/tmp/rename.pl +++ b/tmp/rename.pl @@ -42,7 +42,7 @@ my %warnings; while( my $filename = shift ) { print STDERR "$filename... "; - if( -d $filename ) { print STDERR "skip (directory)"; next } + if( -d $filename ) { print STDERR "skip (directory)\n"; next } open my $rfh, '<', $filename or die; my @lines = <$rfh>;