Re: [Module::Build] codebase? paths in .tar.gz?
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2003-12-20 16:25:00
|
Hi,
I applied the documentation part of the patch, but I had already
patched the other stuff in a different way by the time I saw this. Is
it not good to simply die() when there's no version, abstract, or
author? Seems like those should be required.
-Ken
On Saturday, December 20, 2003, at 04:41 AM, Randy W. Sims wrote:
>
> This patch:
>
> * Moves documentation for the C<codebase> parameter to the section
> describing the ppd action.
>
> * Set C<codebase> to default to the distribution name with a '.tar.gz'
> extension. Notify user if the default is used.
>
> * Warn user to edit the produced PPD file if we can't determine values
> for name, version, and abstract.
>
>
> I will leave writing tutorials to someone with more literary talent
> than
> I :-)
>
> Regards,
> Randy.
>
>
> diff -urN Module-Build-orig/lib/Module/Build/PPMMaker.pm
> Module-Build/lib/Module/Build/PPMMaker.pm
> --- Module-Build-orig/lib/Module/Build/PPMMaker.pm 2003-07-25
> 10:15:19.000000000 -0400
> +++ Module-Build/lib/Module/Build/PPMMaker.pm 2003-12-20
> 04:56:36.000000000 -0500
> @@ -15,14 +15,23 @@
> my ($self, %args) = @_;
> my $build = delete $args{build};
>
> - die "Cannot create a PPD file unless codebase argument is given\n"
> - unless exists $args{codebase};
> - my @codebase = ref $args{codebase} ? @{$args{codebase}} :
> ($args{codebase});
> + my $name = $build->dist_name || '';
> + my $author = $build->dist_author || '';
> + my $abstract = $build->dist_abstract || '';
> + my $version = $self->_ppd_version($build->dist_version) || '';
> +
> + die "Cannot determine distribution name.\n" unless length($name);
> +
> + warn "Missing information for PPD. Please edit before
> distributing.\n"
> + unless length($author) && length($abstract) && length($version);
> +
> + unless (exists $args{codebase}) {
> + my $codebase = $build->dist_dir . '.tar.gz';
> + $args{codebase} = $codebase;
> + print "Using a default CODEBASE of '$codebase'\n";
> + }
>
> - my $name = $build->dist_name;
> - my $author = $build->dist_author;
> - my $abstract = $build->dist_abstract;
> - my $version = $self->_ppd_version($build->dist_version);
> + my @codebase = ref $args{codebase} ? @{$args{codebase}} :
> ($args{codebase});
>
> $self->_simple_xml_escape($_) foreach ($abstract, $author);
>
> diff -urN Module-Build-orig/lib/Module/Build.pm
> Module-Build/lib/Module/Build.pm
> --- Module-Build-orig/lib/Module/Build.pm 2003-12-09
> 21:36:45.000000000 -0500
> +++ Module-Build/lib/Module/Build.pm 2003-12-20 04:35:23.000000000
> -0500
> @@ -575,13 +575,6 @@
> version. It looks for the first line matching C<$package\s-\s(.+)>,
> and uses the captured text as the abstract.
>
> -=item codebase
> -
> -This can be either a single scalar string, or an array reference of
> -strings. It is required when creating PPD files. It should be a URL,
> -or URLs, to be used as the value for the C<< <CODEBASE> >> tag in the
> -generated PPD.
> -
> =back
>
> =item subclass()
> @@ -1212,6 +1205,15 @@
>
> Build a PPD file for your distribution.
>
> +This action takes an optional argument C<codebase> which is used in
> +the generated ppd file to specify the (usually relative) URL of the
> +distribution. By default, this value is the distribution name without
> +any path information.
> +
> +Example:
> +
> + perl Build ppd
> codebase="MSWin32-x86-multi-thread/Module-Build-0.21.tar.gz"
> +
> =back
>
> =head2 How Installation Paths are Determined
>
|