Subject: | A fix for some of the 'cannot find ParserDetails.ini' problems |
Makefile.PL asks "Do you want XML::SAX to alter ParserDetails.ini?"
even if you don't have one already. So if you answer 'No' then the
file won't get created and SAX won't work.
The patched Makefile.PL will only ask about modifying the .ini file
if it already exists and will quietly create it otherwise.
Cheers
Grant
PS: Matt, did you get this patch when I mailed it on March 15th?
I know you're busy, but the last three emails I've sent you
have gone unacknowledged.
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/XML-SAX/Makefile.PL,v
retrieving revision 1.14
diff -u -r1.14 Makefile.PL
--- Makefile.PL 2002/01/21 21:44:03 1.14
+++ Makefile.PL 2004/03/15 07:44:32
@@ -1,4 +1,7 @@
use ExtUtils::MakeMaker;
+use File::Basename ();
+use File::Spec ();
+
WriteMakefile(
'NAME' => 'XML::SAX',
@@ -12,7 +15,29 @@
sub MY::install {
package MY;
my $script = shift->SUPER::install(@_);
- if (ExtUtils::MakeMaker::prompt("Do you want XML::SAX to alter ParserDetails.ini?", "Y") =~ /^y/i) {
+
+ # Only modify existing ParserDetails.ini if user agrees
+
+ my $write_ini_ok = 0;
+
+ eval { require XML::SAX };
+ if ($@) {
+ $write_ini_ok = 1;
+ }
+ else {
+ my $dir = File::Basename::dirname($INC{'XML/SAX.pm'});
+ if (-e File::Spec->catfile($dir, 'SAX', 'ParserDetails.ini')) {
+ $write_ini_ok =
+ ExtUtils::MakeMaker::prompt(
+ "Do you want XML::SAX to alter ParserDetails.ini?", "Y"
+ ) =~ /^y/i;
+ }
+ else {
+ $write_ini_ok = 1;
+ }
+ }
+
+ if ($write_ini_ok) {
$script =~ s/install :: (.*)$/install :: $1 install_sax_pureperl/m;
$script .= <<"INSTALL";