Re: [Module::Build] [PATCH] ppm_dist action
Status: Beta
Brought to you by:
kwilliams
|
From: Glenn L. <pe...@ne...> - 2004-01-14 04:31:36
|
On approximately 1/13/2004 6:46 PM, came the following characters from
the keyboard of Randy W. Sims:
>> * For backwards compatibility (not really sure it's neccessary at this
>> point, but...) I'd suggest leaving the 'ppd' action as is, and create
>> a new 'ppm_dist' action that runs the 'ppd' action and creates an
>> archive of the blib directory, running the 'build' action if
>> neccessary. Ken?
>
>
> Attached is a patch that adds a new 'ppm_dist' action. It accepts a
> 'codebase' argument just like the 'ppd' action. This action runs the
> 'ppd' action and then builds an archive of the blib directory. Glenn,
> this should allow you to "install on the same machine it is built on".
> The 'ppd' action remains unchanged. Please let me know if this patch is
> correct.
Perhaps it is correct, but I can't apply it to whatever version of
Base.pm I have... which claims to be 0.21_02
C:\Perl\site\lib\Module\Build>patch < Base.diff
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- Base.pm.orig 2004-01-10 23:19:59.000000000 -0500
|+++ Base.pm 2004-01-13 21:08:14.000000000 -0500
--------------------------
Patching file Base.pm using Plan A...
print() on unopened filehandle NULL at C:\Perl\bin/patch line 717, <IN>
line 3579.
print() on unopened filehandle NULL at C:\Perl\bin/patch line 723, <IN>
line 3579.
Hunk #1 succeeded at 1454.
Offset: -9
Hunk #2 failed--Couldn't find anywhere to put hunk.
1 out of 2 hunks ignored--saving rejects to Base.pm.rej
done
> Note that this does not address the problems with archivers being unable
> to read A::T created archives, but that should not affect this as A::T
> should be able to read the archives it creates.
Right. That would take A::T changes. In fact, that would take more
A::T changes than we have seen thus far. Of course, I'm not sure I'd
have noticed the problem with the paths produced by A::T if M::B hadn't
had a few rough edges. So for the benefit of all A::T archive creation
users, I'm glad the discussion is happening, and I hope more than
discussion happens.
> Regards,
> Randy.
>
>
> ------------------------------------------------------------------------
>
> --- Base.pm.orig 2004-01-10 23:19:59.000000000 -0500
> +++ Base.pm 2004-01-13 21:08:14.000000000 -0500
> @@ -1463,6 +1463,13 @@
> $self->add_to_cleanup($file);
> }
>
> +sub ACTION_ppm_dist {
> + my ($self) = @_;
> +
> + $self->depends_on('build', 'ppd');
> + $self->make_tarball($self->{properties}{blib}, $self->dist_dir);
> +}
> +
> sub ACTION_dist {
> my ($self) = @_;
>
> @@ -1731,18 +1738,22 @@
> }
>
> sub make_tarball {
> - my ($self, $dir) = @_;
> + my ($self, $dir, $file) = @_;
> + $file ||= $dir;
>
> - print "Creating $dir.tar.gz\n";
> + print "Creating $file.tar.gz\n";
>
> if ($self->{args}{tar}) {
> my $tar_flags = $self->{properties}{verbose} ? 'cvf' : 'cf';
> - $self->do_system($self->{args}{tar}, $tar_flags, "$dir.tar", $dir);
> - $self->do_system($self->{args}{gzip}, "$dir.tar") if $self->{args}{gzip};
> + $self->do_system($self->{args}{tar}, $tar_flags, "$file.tar", $dir);
> + $self->do_system($self->{args}{gzip}, "$file.tar") if $self->{args}{gzip};
> } else {
> require Archive::Tar;
> + # Archive::Tar versions >= 1.09 use the following to enable a compatibility
> + # hack so that the resulting archive is compatible with older clients.
> + $Archive::Tar::DO_NOT_USE_PREFIX = 0;
> my $files = $self->rscan_dir($dir);
> - Archive::Tar->create_archive("$dir.tar.gz", 1, @$files);
> + Archive::Tar->create_archive("$file.tar.gz", 1, @$files);
> }
> }
>
--
Glenn -- http://nevcal.com/
===========================
The best part about procrastination is that you are never bored,
because you have all kinds of things that you should be doing.
|