Skip Menu |

This queue is for tickets about the XML-SAX CPAN distribution.

Report information
The Basics
Id: 62330
Status: open
Priority: 0/
Queue: XML-SAX

People
Owner: Nobody in particular
Requestors: jrcd83 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: Justin Davis <jrcd83 [...] gmail.com>
Subject: [PATCH] Fix bug where updating ParserDetails.ini fails when using DESTDIR.
Date: Wed, 20 Oct 2010 12:23:05 -0700
To: bug-XML-SAX [...] rt.cpan.org
From: Justin Davis <jrcd83 [...] gmail.com>
'make install DESTDIR=$pkgdir' is used when packaging modules. The DESTDIR option installs the distribution into the given directory preserving the directory structure. The packager then compresses the directory with the added package information. When using DESTDIR, the Makefile is unable to load XML::SAX in order to update the ParserDetails.ini file because the DESTDIR is not in @INC and the perl interpreter cannot find XML/SAX.pm. This patch allows the Makefile to guess where the XML/SAX.pm file will end up and adds this directory to @INC using the -I perl switch. I have also switched to the single-quote heredoc because escaping all of the $'s and @'s was annoying. Replacing the install :: rule's text was unnecessary. Because it is a double-color rule it can appear more than once. I added some simple Makefile logic that will store the expected destination of XML/SAX.pm in a make variable ("XMLSAXINC") depending on which INSTALLDIRS are given. When packaging I set INSTALLDIRS to vendor but the default is site. I am not aware of alternatives. --- Makefile.PL | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 98928b3..dda94ac 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -38,11 +38,21 @@ sub MY::install { } if ($write_ini_ok) { - $script =~ s/install :: (.*)$/install :: $1 install_sax_pureperl/m; - $script .= <<"INSTALL"; + $script .= <<'INSTALL'; + +install :: install_sax_pureperl + +ifeq ($(INSTALLDIRS),site) +XMLSAXINC = $(DESTINSTALLSITELIB) +else ifeq ($(INSTALLDIRS),vendor) +XMLSAXINC = $(DESTINSTALLVENDORLIB) +else +$(error Failed to detect destination. Unknown INSTALLDIRS: $(INSTALLDIRS)) +endif install_sax_pureperl : -\t\@\$(PERL) -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()" + @$(PERL) -I$(XMLSAXINC) -MXML::SAX \ + -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()" INSTALL -- 1.7.3
I found this problem thanks to bug #62289. https://rt.cpan.org/Ticket/Display.html?id=62289 Xenoterracide CCed me in that bug report. I found the cause of the problem and submitted this patch. Xenoterracide uses my packaging module, CPANPLUS::Dist::Arch which exposes this bug for all packager programs (because they use DESTDIR). I used Git::CPAN::Patch to send this patch but the In-Reply-To email field didn't seem to help attach it to the other issue. Owell. Basically, this is the solution to bug #62289.
Switched status back to new...
On Wed Oct 20 15:32:12 2010, JUSTER wrote: Show quoted text
> Switched status back to new...
Nope that didn't work. Owell again.