On Jan 9, 2008 9:57 AM, Roderich Schupp <[EMAIL PROTECTED]> wrote:
> Yeah, I had to "nmake clean" first to see the effects of the patch.
> BTW that indicates that the dependencies in myldr/Makefile are incomplete.
Digging further...the dependencies are correct, the problem is the
last step in the
rebuild, regenerating blib\PAR\StrippedPARL\{Dynamic,Static}.pm:
C:\Programme\ActivePerl\bin\perl.exe encode_append.pl .\par.exe
..\blib\lib\PAR\StrippedPARL\Dynamic.pm
Output file '..\blib\lib\PAR\StrippedPARL\Dynamic.pm' does not have an
empty __DATA__ section. Not appending encoded data from '.\par.exe'.
This is NOT a fatal error! at encode_append.pl line 26.
i.e. encode_append.pl refuses to overwrite the obsolete __DATA__ sections from
the last build. Patch attached.
Cheers, Roderich
--- PAR-Packer-0.977-orig/myldr/encode_append.pl 2007-12-20 21:49:53.000000000 +0100
+++ PAR-Packer-0.977-hHBnaH/myldr/encode_append.pl 2008-01-09 09:51:22.182025600 +0100
@@ -2,7 +2,7 @@
use warnings;
# Used in myldr/Makefile.PL / myldr/Makefile.
# This script appends the uuencoded contents of $ARGV[0] to the file
-# specified as $ARGV[1] if the file in $ARGV[1] ends with an empty __DATA__
+# specified as $ARGV[1] as __DATA__ section. Any previous _DATA_ is replaced.
# section.
#
# 2006, Steffen Mueller
@@ -20,17 +20,17 @@
die $usage if not defined $outfile or not -f $outfile;
open my $fh, '<', $outfile or die $!;
+binmode $fh;
my $contents = <$fh>;
close $fh;
-if (not defined $contents or $contents !~ /__DATA__\s*$/s) {
- warn "Output file '$outfile' does not have an empty __DATA__ section. Not appending encoded data from '$infile'. This is NOT a fatal error!";
- exit();
-}
+$contents =~ s/^__DATA__\r?\n.*\z//ms;
open my $ih, '<', $infile or die $!;
binmode $ih;
-open $fh, '>>', $outfile or die $!;
+open $fh, '>', $outfile or die $!;
binmode $fh;
+print $fh $contents;
+print $fh "\n__DATA__\n";
print $fh pack 'u', <$ih>;
close $ih;
close $fh;