diff -urN C:\DTEMP\HTML-Tidy-1.08\fixmf.cgi HTML-Tidy-1.09\fixmf.cgi --- C:\DTEMP\HTML-Tidy-1.08\fixmf.cgi Thu Jan 01 01:00:00 1970 +++ HTML-Tidy-1.09\fixmf.cgi Thu Jul 31 14:14:00 2008 @@ -0,0 +1,57 @@ +#!Perl -W +#NAME: fixmf.cgi +#AIM: To adjust the Makefile generated for things I can NOT seem +# to adjust using Makefile.PL +use strict; +use warnings; +my $exit = 4; +my $in_file = 'Makefile'; +my $out_file = $in_file; + +if (open INF, "<$in_file") { + my @lines = ; + close INF; + my $lncnt = scalar @lines; + my $lnnum = 0; + my $chges = 0; + prt( "Processing $lncnt lines in $in_file ...\n" ); + for (my $i = 0; $i < $lncnt; $i++) { + $lnnum++; + my $line = $lines[$i]; + if ($line =~ /msvcrt\./) { + my $ln = $line; + chomp $ln; + prt( "$lnnum: Found [$ln]\n" ); + $line =~ s/msvcrt\./libcmt\./g; + $lines[$i] = $line; + $chges++; + $ln = $line; + chomp $ln; + prt( "$lnnum: Change [$line]\n" ); + } + } + if ($chges) { + if (open OUTF, ">$out_file") { + print OUTF join("", @lines); + close OUTF; + prt( "Written changed $out_file ... with $chges changes ...\n" ); + $exit = 0; + } else { + prt( "ERROR: Failed to create OUT file ...\n" ); + $exit = 2; + } + } +} else { + prt( "ERROR: Failed to open $in_file ...\n" ); + $exit = 3; +} +prt( "Exit with ERRORLEVEL $exit ...\n" ); +exit($exit); +####################### + +sub prt { + my ($txt) = shift; + print $txt; +} + +# eof - fixmf.cgi diff -urN C:\DTEMP\HTML-Tidy-1.08\lib\HTML\Tidy\Message.pm HTML-Tidy-1.09\lib\HTML\Tidy\Message.pm --- C:\DTEMP\HTML-Tidy-1.08\lib\HTML\Tidy\Message.pm Sat Apr 14 04:55:24 2007 +++ HTML-Tidy-1.09\lib\HTML\Tidy\Message.pm Wed Jul 30 13:03:44 2008 @@ -97,6 +97,7 @@ my %strings = ( 1 => 'Warning', 2 => 'Error', + 3 => 'Info', ); return sprintf( '%s %s %s: %s', diff -urN C:\DTEMP\HTML-Tidy-1.08\lib\HTML\Tidy.pm HTML-Tidy-1.09\lib\HTML\Tidy.pm --- C:\DTEMP\HTML-Tidy-1.08\lib\HTML\Tidy.pm Sat Apr 14 04:53:38 2007 +++ HTML-Tidy-1.09\lib\HTML\Tidy.pm Thu Jul 31 10:57:31 2008 @@ -17,7 +17,7 @@ =cut -our $VERSION = '1.08'; +our $VERSION = '1.09'; =head1 SYNOPSIS @@ -47,10 +47,11 @@ use base 'Exporter'; +use constant TIDY_INFO => 3; use constant TIDY_ERROR => 2; use constant TIDY_WARNING => 1; -our @EXPORT = qw( TIDY_ERROR TIDY_WARNING ); +our @EXPORT = qw( TIDY_INFO TIDY_ERROR TIDY_WARNING ); =head1 METHODS @@ -243,9 +244,9 @@ chomp $line; my $message; - if ( $line =~ /^line (\d+) column (\d+) - (Warning|Error): (.+)$/ ) { + if ( $line =~ /^line (\d+) column (\d+) - (Warning|Error|Info): (.+)$/ ) { my ($line, $col, $type, $text) = ($1, $2, $3, $4); - $type = ($type eq 'Warning') ? TIDY_WARNING : TIDY_ERROR; + $type = ($type eq 'Warning') ? TIDY_WARNING : ($type eq 'Error') ? TIDY_ERROR : TIDY_INFO; $message = HTML::Tidy::Message->new( $filename, $type, $line, $col, $text ); } @@ -254,8 +255,9 @@ } elsif ( $line eq 'No warnings or errors were found.' ) { - # Summary line we don't want - + # Summary line we don't want - seem to get SEGFAULT when this happens + # 20080730 - try generating a message - BUT MAYBE NOT due other probs!!! + #$message = HTML::Tidy::Message->new( $filename, TIDY_INFO, 0, 0, $line ); } elsif ( $line eq 'This document has errors that must be fixed before' ) { # Summary line we don't want diff -urN C:\DTEMP\HTML-Tidy-1.08\Makefile.PL HTML-Tidy-1.09\Makefile.PL --- C:\DTEMP\HTML-Tidy-1.08\Makefile.PL Sat Nov 11 05:06:24 2006 +++ HTML-Tidy-1.09\Makefile.PL Thu Jul 31 11:00:14 2008 @@ -8,8 +8,24 @@ use ExtUtils::MakeMaker; use ExtUtils::Liblist; -my @vars = ExtUtils::Liblist->ext( '-L/sw/lib -ltidy', 0, 1 ); -my $libs = $vars[2]; +my $os = $^O; +my @vars = (); +my $libs = ''; +my $incs = ''; + +if ($os =~ /^MSWin/i) { + # this must set to where you unpacked, and built HTML Tidy + my $tidylib = 'C:\Projects\Tidy\Tidy4p5'; + $incs = '-I. -I'.$tidylib.'\include'; + # and this MUST be likewise adjusted to WHERE you have built libtidy.[DLL/LIB] + @vars = ExtUtils::Liblist->ext( '-L'.$tidylib.'\build\msvc\ReleaseDLL -ltidy', 0, 1 ); + # and REMEMBER, libtidy.dll MUST be copied to a PATH in your environment +} else { + @vars = ExtUtils::Liblist->ext( '-L/sw/lib -ltidy', 0, 1 ); + $incs = '-I. -I/usr/include/tidy -I/usr/local/include/tidy -I/sw/include/tidy'; +} + +$libs = $vars[2]; if ( !$libs ) { $libs = '-ltidy'; @@ -55,8 +71,7 @@ LIBS => [$libs], NEEDS_LINKING => 1, - INC => '-I. -I/usr/include/tidy -I/usr/local/include/tidy -I/sw/include/tidy', - + INC => $incs, EXE_FILES => [qw(bin/webtidy)], dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'HTML-Tidy-*' }, diff -urN C:\DTEMP\HTML-Tidy-1.08\t\simple.t HTML-Tidy-1.09\t\simple.t --- C:\DTEMP\HTML-Tidy-1.08\t\simple.t Sat Apr 14 04:56:42 2007 +++ HTML-Tidy-1.09\t\simple.t Wed Jul 30 13:07:38 2008 @@ -17,7 +17,7 @@ $tidy->parse( '-', $html ); my @messages = $tidy->messages; -is( scalar @messages, 5, 'Right number of initial messages' ); +is( scalar @messages, 8, 'Right number of initial messages' ); $tidy->clear_messages; is( scalar $tidy->messages, 0, 'Cleared the messages' ); diff -urN C:\DTEMP\HTML-Tidy-1.08\t\too-many-titles.t HTML-Tidy-1.09\t\too-many-titles.t --- C:\DTEMP\HTML-Tidy-1.08\t\too-many-titles.t Mon Sep 25 05:40:02 2006 +++ HTML-Tidy-1.09\t\too-many-titles.t Wed Jul 30 13:00:51 2008 @@ -13,6 +13,7 @@ my @expected = split /\n/, q{ - (1:1) Warning: missing declaration - (4:9) Warning: too many title elements in +- (4:9) Info: previously mentioned }; chomp @expected; shift @expected; # First one's blank