Subject: | Turn off crlf translation when slurping the package files |
The package file can't properly be uncompressed on Windows because it isn't read in binary mode. The testsuite doesn't catch this because it uses a text package file.
The attached patch properly calls binmode on the filehandles.
Vincent.
The attached patch properly calls binmode on the filehandles.
Vincent.
Subject: | Parse-CPAN-Packages-binmode.patch |
--- lib/Parse/CPAN/Packages.pm 2009-04-23 12:56:07.000000000 +0200
+++ lib/Parse/CPAN/Packages.pm 2010-01-04 16:34:59.000000000 +0100
@@ -39,6 +39,7 @@
return $filename;
} elsif ( $filename =~ /\.gz/ ) {
open( IN, $filename ) || die "Failed to read $filename: $!";
+ binmode *IN;
my $data = join '', <IN>;
close(IN);
return Compress::Zlib::memGunzip($data);
@@ -46,8 +47,10 @@
return Compress::Zlib::memGunzip($filename);
} else {
open( IN, $filename ) || die "Failed to read $filename: $!";
- return join '', <IN>;
+ binmode *IN;
+ my $data = join '', <IN>;
close(IN);
+ return $data;
}
}