sanitize some Perl scripts
(Perl4 is gone)
This commit is contained in:
parent
4cdc304e37
commit
808616d406
30
filter.pl
30
filter.pl
@ -2,29 +2,29 @@
|
||||
|
||||
# we want to filter every between START_INS and END_INS out and then insert crap from another file (this is fun)
|
||||
|
||||
$dst = shift;
|
||||
$ins = shift;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
open(SRC,"<$dst");
|
||||
open(INS,"<$ins");
|
||||
open(TMP,">tmp.delme");
|
||||
open(my $src, '<', shift);
|
||||
open(my $ins, '<', shift);
|
||||
open(my $tmp, '>', 'tmp.delme');
|
||||
|
||||
$l = 0;
|
||||
while (<SRC>) {
|
||||
my $l = 0;
|
||||
while (<$src>) {
|
||||
if ($_ =~ /START_INS/) {
|
||||
print TMP $_;
|
||||
print {$tmp} $_;
|
||||
$l = 1;
|
||||
while (<INS>) {
|
||||
print TMP $_;
|
||||
while (<$ins>) {
|
||||
print {$tmp} $_;
|
||||
}
|
||||
close INS;
|
||||
close $ins;
|
||||
} elsif ($_ =~ /END_INS/) {
|
||||
print TMP $_;
|
||||
print {$tmp} $_;
|
||||
$l = 0;
|
||||
} elsif ($l == 0) {
|
||||
print TMP $_;
|
||||
print {$tmp} $_;
|
||||
}
|
||||
}
|
||||
|
||||
close TMP;
|
||||
close SRC;
|
||||
close $tmp;
|
||||
close $src;
|
||||
|
21
fixupind.pl
21
fixupind.pl
@ -1,11 +1,16 @@
|
||||
open(IN,"<crypt.ind");
|
||||
open(OUT,">crypt.ind.tmp");
|
||||
$a = <IN>;
|
||||
print OUT "$a\n\\addcontentsline{toc}{chapter}{Index}\n";
|
||||
while (<IN>) {
|
||||
print OUT $_;
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
open(my $in, '<', 'crypt.ind');
|
||||
open(my $out, '>', 'crypt.ind.tmp');
|
||||
my $a = <$in>;
|
||||
print {$out} "$a\n\\addcontentsline{toc}{chapter}{Index}\n";
|
||||
while (<$in>) {
|
||||
print {$out} $_;
|
||||
}
|
||||
close OUT;
|
||||
close IN;
|
||||
close $out;
|
||||
close $in;
|
||||
system("mv -f crypt.ind.tmp crypt.ind");
|
||||
|
||||
|
3
makefile
3
makefile
@ -406,6 +406,9 @@ check_defines:
|
||||
| grep -v -e 'LTC_ECC[0-9]*' -e 'LTC_DH[0-9]*' -e 'LTC_NO_' -e 'LTC_MUTEX' -e 'LTC_MPI' \
|
||||
| xargs -I '{}' sh -c 'grep -q -m 1 -o {} src/misc/crypt/crypt.c || echo {} not found'
|
||||
|
||||
perlcritic:
|
||||
perlcritic *.pl
|
||||
|
||||
# $Source$
|
||||
# $Revision$
|
||||
# $Date$
|
||||
|
@ -4,20 +4,25 @@
|
||||
# wrapped at 80 chars
|
||||
#
|
||||
# Tom St Denis
|
||||
@a = split(" ", $ARGV[1]);
|
||||
$b = "$ARGV[0]=";
|
||||
$len = length($b);
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my @a = split ' ', $ARGV[1];
|
||||
my $b = $ARGV[0] . '=';
|
||||
my $len = length $b;
|
||||
print $b;
|
||||
foreach my $obj (@a) {
|
||||
$len = $len + length($obj);
|
||||
$len = $len + length $obj;
|
||||
$obj =~ s/\*/\$/;
|
||||
if ($len > 100) {
|
||||
printf "\\\n";
|
||||
$len = length($obj);
|
||||
print "\\\n";
|
||||
$len = length $obj;
|
||||
}
|
||||
print "$obj ";
|
||||
print $obj . ' ';
|
||||
}
|
||||
if ($ARGV[0] eq 'HEADERS') {
|
||||
print 'testprof/tomcrypt_test.h';
|
||||
}
|
||||
if ($ARGV[0] eq "HEADERS") { print "testprof/tomcrypt_test.h"; }
|
||||
|
||||
print "\n\n";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user