diff options
author | cvs2git <cvs2git> | 2006-08-23 22:25:40 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2006-08-23 22:25:40 +0000 |
commit | 58d093219cf60264550b8c34649d9f3190eda042 (patch) | |
tree | 10418dd70b52416a5f52da8e17d8e282d914595d /bin/masonize | |
parent | 3ce7691203a7737406bf2d4442f7fd84b81f847e (diff) |
This commit was manufactured by cvs2svn to create tagAFTER_FINAL_MASONIZE
'AFTER_FINAL_MASONIZE'.
Diffstat (limited to 'bin/masonize')
-rwxr-xr-x | bin/masonize | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/bin/masonize b/bin/masonize deleted file mode 100755 index 509ef3ec8..000000000 --- a/bin/masonize +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/perl - -foreach $file ( split(/\n/, `find . -depth -print`) ) { - next unless $file =~ /(cgi|html)$/; - open(F,$file) or die "can't open $file for reading: $!"; - @file = <F>; - #print "$file ". scalar(@file). "\n"; - close $file; - $newline = ''; #avoid prepending extraneous newlines - $all = join('',@file); - - $w = ''; - - $mode = 'html'; - while ( length($all) ) { - - if ( $mode eq 'html' ) { - - if ( $all =~ /^(.+?)(<%=?.*)$/s && $1 !~ /<%/s ) { - $w .= $1; - $all = $2; - next; - } elsif ( $all =~ /^<%=(.*)$/s ) { - $w .= '<%'; - $all = $1; - $mode = 'perlv'; - #die; - next; - } elsif ( $all =~ /^<%(.*)$/s ) { - $w .= $newline; $newline = "\n"; - $all = $1; - $mode = 'perlc'; - - #avoid newline prepend fix from borking indented first <% - $w =~ s/\n\s+\z/\n/; - $w .= "\n" if $w =~ /.+\z/; - - next; - } elsif ( $all !~ /<%/s ) { - $w .= $all; - last; - } else { - warn length($all); die; - } - die; - - } elsif ( $mode eq 'perlv' ) { - - if ( $all =~ /^(.*?%>)(.*)$/s ) { - $w .= $1; - $all=$2; - $mode = 'html'; - next; - } - die "unterminated <%= ??? (in $file):"; - - } elsif ( $mode eq 'perlc' ) { - - if ( $all =~ /^([^\n]*?)%>(.*)$/s ) { - $w .= "%$1\n"; - $all=$2; - $mode='html'; - next; - } - if ( $all =~ /^([^\n]*)\n(.*)$/s ) { - $w .= "%$1\n"; - $all=$2; - next; - } - - } else { die }; - - } - - system("chmod u+w $file"); - select W; $| = 1; select STDOUT; - open(W,">$file") or die "can't open $file for writing: $!"; - print W $w; - close W; -} |