Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Module::Build and ActiveState

1 view
Skip to first unread message

Klaus

unread,
Jan 6, 2010, 11:03:13 AM1/6/10
to module-...@perl.org
There are problems in the way that Module::Build interacts with
ActiveState Perl, those problems are:

- HTML generated with Module::Build is not conform
with the way HTML is generated by ActiveState /
ExtUtils::MakeMaker

- with Module::Build, ActiveState's Table of Contents
(html\index.html) is not updated (with
ExtUtils::MakeMaker it is updated)

- with Module::Build, the file 'lib/perllocal.pod' is not
updated, which leaves ActiveState's PPM-utility in
the dark about the newly installed distribution. (with
ExtUtils::MakeMaker the file 'lib/perllocal.pod' is
correctly updated)

I have a patch that fixes those problems. 3 modules are to be patched:
"ActivePerl::DocTools::Pod", "ExtUtils::Command::MM" and
"Module::Build::Base".

Who do I need to contact to have all 3 modules patched at the same
time ?

Here are the details of the patch:

--- lib/ActivePerl/DocTools/Pod.pm.bak 2010-01-06 15:17:20.201000000
+0100
+++ lib/ActivePerl/DocTools/Pod.pm 2010-01-06 15:17:20.201000000
+0100
@@ -43,6 +43,11 @@
"--outfile=$outfile",
"--css=${html_root}/Active.css",
);
+ html_fix($outfile, $html_root, $index, $depth);
+}
+
+sub html_fix {
+ my ($outfile, $html_root, $index, $depth) = @_;

open (HTMLFILE, "<$outfile") or die "Couldn't open $outfile: $!";
open (TMPFILE, ">$outfile.tmp") or die "Couldn't open
$outfile.tmp: $!";
@@ -71,7 +76,9 @@
if ($content =~ /<TITLE>/i) {
until ($content =~ /<\/TITLE>/i) {
chomp $content;
- $content .= " " . <HTMLFILE>;
+ my $fragment = <HTMLFILE>;
+ last unless defined $fragment; # bail-out if you hit
End-of-File
+ $content .= " " . $fragment;
}
}

--- lib/ExtUtils/Command/MM.pm.bak 2010-01-06 15:17:20.201000000
+0100
+++ lib/ExtUtils/Command/MM.pm 2010-01-06 15:17:20.201000000
+0100
@@ -206,6 +206,13 @@
my @mod_info = $Is_VMS ? split /\|/, <STDIN>
: @ARGV;

+ print perllocal_instd($type, $name, @mod_info);
+}
+
+sub perllocal_instd {
+ my($type, $name) = splice(@_, 0, 2);
+ my @mod_info = @_;
+
my $pod;
$pod = sprintf <<POD, scalar localtime;
=head2 %s: C<$type> L<$name|$name>
@@ -228,9 +235,8 @@

$pod .= "=back\n\n";
$pod =~ s/^ //mg;
- print $pod;

- return 1;
+ return $pod;
}

=item B<uninstall>
--- lib/Module/Build/Base.pm.bak 2010-01-06 15:17:20.201000000
+0100
+++ lib/Module/Build/Base.pm 2010-01-06 15:17:20.201000000
+0100
@@ -861,8 +861,9 @@
},
);

+my $Is_ActivePerl;
{
- my $Is_ActivePerl = eval {require ActivePerl::DocTools};
+ $Is_ActivePerl = eval {require ActivePerl::DocTools};
__PACKAGE__->add_property(html_css => $Is_ActivePerl ?
'Active.css' : '');
}

@@ -2871,7 +2872,8 @@
my $path2root = join( '/', ('..') x (@rootdirs+@dirs) );
my $htmlroot = join( '/',
($path2root,
- $self->installdirs eq 'core' ? () : qw
(site) ) );
+ ($self->installdirs eq 'core' or
$Is_ActivePerl)
+ ? () : qw(site) ) );

my $fh = IO::File->new($infile) or die "Can't read $infile: $!";
my $abstract = Module::Build::PodParser->new(fh => $fh)-
>get_abstract();
@@ -2880,8 +2882,9 @@
$title .= " - $abstract" if $abstract;

my @opts = (
- '--flush',
- "--title=$title",
+ ($Is_ActivePerl ? ('--quiet', '--index',
+ '--
libpods=perlfunc:perlguts:perlvar:perlrun:perlopt')
+ : ('--flush', "--title=$title")),
"--podpath=$podpath",
"--infile=$infile",
"--outfile=$outfile",
@@ -2890,7 +2893,7 @@
);

if ( eval{Pod::Html->VERSION(1.03)} ) {
- push( @opts, ('--header', '--backlink=Back to Top') );
+ push( @opts, ('--header', '--backlink=Back to Top') ) unless
$Is_ActivePerl;
push( @opts, "--css=$path2root/" . $self->html_css) if $self-
>html_css;
}

@@ -2898,6 +2901,13 @@
$self->log_verbose("pod2html @opts\n");
eval { Pod::Html::pod2html(@opts); 1 }
or $self->log_warn("pod2html @opts failed: $@");
+
+ if ($Is_ActivePerl) {
+ my $dp = @rootdirs + @dirs;
+ require ActivePerl::DocTools::Pod;
+ ActivePerl::DocTools::Pod::html_fix($outfile, $htmlroot,
'index', $dp);
+ }
+
}

}
@@ -2983,6 +2993,17 @@
require ExtUtils::Install;
$self->depends_on('build');
ExtUtils::Install::install($self->install_map, !$self->quiet, 0,
$self->{args}{uninst}||0);
+
+ if ($Is_ActivePerl) {
+ # The main reason for writing to "lib/perllocal.pod" is to get
a new timestamp
+ # for that file. The new timestamp is very important for
ActiveState's ppm-utility,
+ # see also 'ActivePerl/PPM/InstallArea.pm', subroutine _init_db
(),
+ # ==> expression ((stat $perllocal)[9] || 0))
+ $self->write_perllocal();
+
+ # writing ActiveState Table of Content in HTML Format
+ ActivePerl::DocTools::WriteTOC();
+ }
}

sub ACTION_fakeinstall {
@@ -3013,6 +3034,41 @@
only::install::install(%onlyargs);
}

+sub write_perllocal {
+ my $self = shift;
+
+ if (my $corelib = $self->{config}->get('installprivlib')) {
+
+ # the following '$into_dir' could be more flexible
+ # ==> hint: $self->installdirs, [$self->install_types],
+ # $self->install_destination($type)
+ my $into_dir = $self->install_destination('arch') || '';
+
+ require ExtUtils::Command::MM;
+ my $podinfo = ExtUtils::Command::MM::perllocal_instd(
+ 'Module' => $self->module_name, # Module name
+ 'installed into' => $into_dir, # where the distro
is installed into
+ 'LINKTYPE' => 'dynamic', # don't know if
LINKTYPE is always 'dynamic' ?
+ 'VERSION' => $self->dist_version, # Version of the
distribution
+ 'EXE_FILES' => '', # Can't find
anything meaningful in properties
+ );
+
+ my $perllocal = File::Spec->catfile($corelib,
'perllocal.pod');
+ if (open(PODF, ">>$perllocal")) {
+ print PODF $podinfo;
+ close PODF;
+ print "Appending installation info to $perllocal\n"
unless $self->quiet;
+ }
+ else {
+ print "Warning: Could not open >> '$perllocal' because $!
\n" unless $self->quiet;
+ }
+ }
+ else {
+ print "Warning: Could not find \$self->{config}->get
('installprivlib') ",
+ "for self ==> $self\n" unless $self->quiet;
+ }
+}
+
sub ACTION_clean {
my ($self) = @_;
foreach my $item (map glob($_), $self->cleanup) {

David Golden

unread,
Jan 7, 2010, 7:45:54 AM1/7/10
to Klaus, module-...@perl.org
On Wed, Jan 6, 2010 at 11:03 AM, Klaus <kla...@gmail.com> wrote:
> I have a patch that fixes those problems. 3 modules are to be patched:
> "ActivePerl::DocTools::Pod", "ExtUtils::Command::MM" and
> "Module::Build::Base".
>
> Who do I need to contact to have all 3 modules patched at the same
> time ?

For Module::Build, please open an RT ticket with the patch and I or
someone else will get around to it in due time:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build

For ExtUtils::Command::MM, you need to contact Schwern, either
directly by email or via the RT queue for ExtUtils-MakerMaker:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-MakeMaker

I have no idea who you need to contact at ActiveState.

Regards,
David

jon...@gmail.com

unread,
Jan 7, 2010, 7:59:19 AM1/7/10
to Klaus, Module Authors, David Golden
For ActiveState perhaps their Bugzilla instance?

http://bugs.activestate.com/

jonasbn
--
AIM: BjonasN Gtalk: jon...@gmail.com
ICQ: 62401545 MSN: jon...@io.dk
twitter: jonasbn blog: http://e-diot.dk/

Klaus

unread,
Jan 7, 2010, 10:12:39 AM1/7/10
to module-...@perl.org, David Golden, Jonas Brømsø Nielsen, Klaus
> On Wed, Jan 6, 2010 at 11:03 AM, Klaus <klau...@gmail.com> wrote:
> > I have a patch that fixes those problems. 3 modules are to be patched:
> > "ActivePerl::DocTools::Pod", "ExtUtils::Command::MM" and
> > "Module::Build::Base".

> On 7 jan, 13:59, jona...@gmail.com wrote:
> > For ActiveState perhaps their Bugzilla instance?
> > http://bugs.activestate.com/

I have created a ticket to change ActivePerl::DocTools::Pod at
http://bugs.activestate.com/show_bug.cgi?id=85755

> On 07/01/2010, at 13.45, David Golden wrote:
> > For ExtUtils::Command::MM, you need to contact Schwern, either
> > directly by email or via the RT queue for ExtUtils-MakerMaker:
> > http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-MakeMaker

I have created a ticket to change ExtUtils::Command::MM at
http://rt.cpan.org/Public/Bug/Display.html?id=53478

> On 07/01/2010, at 13.45, David Golden wrote:
> > For Module::Build, please open an RT ticket with the patch and I or
> > someone else will get around to it in due time:
> > http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build

I will open an RT ticket with the patch for Module::Build as soon as
the two previous tickets (for "ActivePerl::DocTools::Pod" and for
"ExtUtils::Command::MM") are actioned.

Klaus

unread,
Jan 9, 2010, 2:25:08 PM1/9/10
to module-...@perl.org
On 7 jan, 16:12, klau...@gmail.com (Klaus) wrote:
> > On Wed, Jan 6, 2010 at 11:03 AM, Klaus <klau...@gmail.com> wrote:
> > > I have a patch that fixes those problems. 3 modules are to be patched:
> > > "ActivePerl::DocTools::Pod", "ExtUtils::Command::MM" and
> > > "Module::Build::Base".
> > On 7 jan, 13:59, jona...@gmail.com wrote:
> > > For ActiveState perhaps their Bugzilla instance?
> > >http://bugs.activestate.com/
>
> I have created a ticket to change ActivePerl::DocTools::Pod at
> http://bugs.activestate.com/show_bug.cgi?id=85755

I haven't had any reply from Activestate yet. I fear that this ticket
is not picked up.

I really would like to discuss this with ActiveState. Does anybody
have an e-mail address at Activestate where I can bring this ticket to
their attention ?

Klaus

unread,
Jan 10, 2010, 6:12:49 AM1/10/10
to module-...@perl.org, kla...@gmail.com

I now have a reply from ActiveState.

0 new messages