Move rename.pl to scripts & add data file

This commit is contained in:
Manuel Pégourié-Gonnard 2015-04-08 14:56:51 +02:00
parent d759d7d720
commit b20a70fcc7
4 changed files with 2206 additions and 15 deletions

View File

@ -48,7 +48,7 @@ if (@ARGV >= 2 && $ARGV[0] eq "-f") {
} else {
if (! -f $config_file) {
chdir '..' or die;
-d $config_file
-f $config_file
or die "Without -f, must be run from root or scripts\n"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +1,33 @@
#!/usr/bin/perl
# rename identifiers (functions, types, enum constant, etc)
# on upgrades of major version according to a list
use warnings;
use strict;
use utf8;
use open qw(:std utf8);
# apply substitutions from the table in the first arg to files
# expected usage: via invoke-rename.pl
my $usage = "Usage: $0 [-f datafile] [-s] [--] [filenames...]\n";
(my $datafile = $0) =~ s/(rename-1\.3-2\.0)\.pl$/data_files\/$1.txt/;
my $do_strings = 0;
if( $ARGV[0] eq "-s" ) {
shift;
$do_strings = 1;
while( @ARGV && $ARGV[0] =~ /^-/ ) {
my $opt = shift;
if( $opt eq '--' ) {
last;
} elsif( $opt eq '-f' ) {
$datafile = shift;
} elsif( $opt eq '-s' ) {
$do_strings = 1; shift;
} else {
die $usage;
}
}
die "Usage: $0 [-s] names-file [filenames...]\n" if( @ARGV < 1 or ! -r $ARGV[0] );
open my $nfh, '<', shift or die;
open my $nfh, '<', $datafile or die "Could not read $datafile\n";
my @names = <$nfh>;
close $nfh or die;

View File

@ -8,12 +8,13 @@ set -eu
tmp/analyze-names.sh
tmp/makelist.pl public-names extra-names > old2new
tmp/rename.pl old2new library/*.c tests/suites/* \
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 library/ssl_???.c tests/ssl-opt.sh \
programs/*.c programs/*/*.c scripts/* tests/scripts/*
scripts/rename.pl -f old2new \
library/*.c tests/suites/* configs/* scripts/data_files/*.fmt
scripts/rename.pl -f old2new -s \
library/error.c library/version_features.c \
library/memory_buffer_alloc.c include/mbedtls/*.h \
library/ecp.c library/ssl_???.c tests/ssl-opt.sh \
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