automatic patching of tex files for cipher strings
authorAaron Kaplan <aaron@lo-res.org>
Mon, 9 Dec 2013 22:58:29 +0000 (23:58 +0100)
committerAaron Kaplan <aaron@lo-res.org>
Mon, 9 Dec 2013 22:58:29 +0000 (23:58 +0100)
src/cipherstringpatch.sh [deleted file]
src/perlify.pl

diff --git a/src/cipherstringpatch.sh b/src/cipherstringpatch.sh
deleted file mode 100644 (file)
index 7c69281..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-find . -name "*.tex" -exec "./perlify.pl  < \{\} > /tmp.foo; mv /tmp.foo \{\}" \;
index c829954..df53313 100755 (executable)
@@ -2,10 +2,26 @@
 
 use strict;
 
 
 use strict;
 
-my $cipherStrB='EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA';
 
 
+my $debug=1;
 
 
-while (<>) {
-       $_ =~ s/\@\@\@CIPHERSTRINGB\@\@\@/$cipherStrB/g;
-       print ;
+my $cipherStrB=`cat cipherStringB.txt`;
+
+
+my @files=`find . -name "*.tex.template" -print`;
+my $f;
+
+foreach  $f ( @files)  {
+       print "file = $f\n" if $debug;
+       $f =~ /(.*\.tex\.)template/;
+       my $ftex = $1;
+
+
+       open(FH,    "<", $f ) or die "could not open file $f: $!";
+       open(FHOUT, ">", $ftex ) or die "could not open file $ftex: $!";
+       
+       while (<FH>) {
+               $_ =~ s/\@\@\@CIPHERSTRINGB\@\@\@/$cipherStrB/g;
+               print FHOUT $_;
+       }
 }
 }