Re: [Module-build-general] squeaking wheel
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2003-04-04 15:39:14
|
On Friday, April 4, 2003, at 06:34 AM, Richard Clamp wrote: > I know I'm being a bit impatient, but I submitted a patch to fix a bug > with scripts support a few days ago, and it's not yet gone in. > > http://rt.cpan.org/NoAuth/Bug.html?id=2321 Okay, this turned from a 1-line patch into the following. I did it this way because I think it's very important to keep consistency with the 'PL_files', 'pm_files', 'xs_files', and so on, so it has to be 'script_files' and not 'scripts'. Likewise, the scripts() method has to change to script_files(). Backward compatibility with 'scripts' and scripts() will be maintained for several versions. -Ken Index: lib/Module/Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.57 diff -u -r1.57 Build.pm --- lib/Module/Build.pm 29 Mar 2003 21:56:37 -0000 1.57 +++ lib/Module/Build.pm 4 Apr 2003 15:36:04 -0000 @@ -392,11 +392,15 @@ directory will be added to the search path during the compilation and linking phases of any C or XS files. -=item scripts +=item script_files An array reference containing a list of files that should be installed as perl scripts when the module is installed. +For backward compatibility, you may use the parameter C<scripts> +instead of C<script_files>. Please consider this usage deprecated, +though it will continue to exists for several version releases. + =item autosplit An optional C<autosplit> argument specifies a file which should be run @@ -608,12 +612,17 @@ about this for a while and this seemed like the most useful way to do it. -=item scripts() +=item script_files() Returns an array reference specifying the perl script files to be -installed. This corresponds to the C<scripts> parameter to the +installed. This corresponds to the C<script_files> parameter to the C<new()> method. With an optional argument, this parameter may be set dynamically. + +For backward compatibility, the C<scripts()> method does exactly the +same thing as C<script_files()>. C<scripts()> is deprecated, but it +will stay around for several versions to give people time to +transition. =item base_dir() Index: lib/Module/Build/Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.84 diff -u -r1.84 Base.pm --- lib/Module/Build/Base.pm 3 Apr 2003 02:54:45 -0000 1.84 +++ lib/Module/Build/Base.pm 4 Apr 2003 15:36:06 -0000 @@ -64,7 +64,7 @@ recommends => {}, build_requires => {}, conflicts => {}, - scripts => [], + script_files => [], perl => $perl, %input, %$cmd_properties, @@ -74,6 +74,7 @@ # Synonyms $p->{requires} = delete $p->{prereq} if exists $p->{prereq}; + $p->{script_files} = delete $p->{scripts} if exists $p->{scripts}; # Shortcuts if (exists $p->{module_name}) { @@ -186,7 +187,7 @@ requires recommends PL_files - scripts + script_files perl config_dir build_script @@ -994,13 +995,14 @@ return "$self->{properties}{dist_name}-$self->{properties}{dist_version}"; } -sub scripts { +sub script_files { my $self = shift; if (@_) { - $self->{properties}{scripts} = ref($_[0]) ? $_[0] : [@_]; + $self->{properties}{script_files} = ref($_[0]) ? $_[0] : [@_]; } - return $self->{properties}{scripts}; + return $self->{properties}{script_files}; } +*scripts = \&script_files; sub valid_licenses { return { map {$_, 1} qw(perl gpl artistic lgpl bsd open_source unrestricted restrictive unknown) }; @@ -1096,7 +1098,7 @@ $arch => $self->{config}{sitearch}); $map{$script} = $self->{config}{installscript} - if @{$self->{properties}{scripts}}; + if @{$self->{properties}{script_files}}; if (length(my $destdir = $self->{properties}{destdir} || '')) { $_ = File::Spec->catdir($destdir, $_) foreach values %map; |