module-build-checkins Mailing List for Module::Build (Page 12)
Status: Beta
Brought to you by:
kwilliams
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(82) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(49) |
Feb
(57) |
Mar
(49) |
Apr
(49) |
May
(2) |
Jun
(147) |
Jul
(60) |
Aug
(55) |
Sep
(51) |
Oct
(68) |
Nov
(61) |
Dec
(44) |
2006 |
Jan
(27) |
Feb
(38) |
Mar
(89) |
Apr
(31) |
May
(17) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Randy W. S. <si...@us...> - 2005-11-16 05:44:20
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21892/lib/Module Modified Files: Build.pm Log Message: Add a section to summarize the location and purpose of the several Module::Build manpages. Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.198 retrieving revision 1.199 diff -u -d -r1.198 -r1.199 --- Build.pm 16 Nov 2005 00:07:41 -0000 1.198 +++ Build.pm 16 Nov 2005 05:44:13 -0000 1.199 @@ -154,6 +154,38 @@ You can run the 'help' action for a complete list of actions. +=head1 GUIDE TO DOCUMENTATION + +The documentation for C<Module::Build> is broken up into three sections: + +=over + +=item General Usage (L<Module::Build>) + +This is the document your are currently reading. It describes basic +usage and background information. Its main purpose is to assist the +user who wants to learn how to invoke and control C<Module::Build> +scripts at the command line. + +=item Authoring Reference (L<Module::Build::Authoring>) + +This document describes the C<Module::Build> API for authors who are +writting F<Build.PL> scripts for a distribution. It describes the +methods available as well as providing general information on +subclassing C<Module::Build> to alter and extend its behavior. Also, +there is a section on controlling the Build process from other +scripts, including how to construct an object and how to invoke +actions through it from an external script. + +=item Cookbook (L<Module::Build::Cookbook>) + +This document demonstrates how to accomplish many common tasks. It +covers general command line usage and authoring of F<Build.PL> +scripts. Includes working examples. + +=back + + =head1 ACTIONS There are some general principles at work here. First, each task when |
From: Randy W. S. <si...@us...> - 2005-11-16 00:07:51
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv851/lib/Module Modified Files: Build.pm Log Message: Move description of F<META.yml> from the 'distdir' action to 'distmeta'. Add links to currently supported version of the F<META.yml> specification. Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.197 retrieving revision 1.198 diff -u -d -r1.197 -r1.198 --- Build.pm 15 Nov 2005 23:01:30 -0000 1.197 +++ Build.pm 16 Nov 2005 00:07:41 -0000 1.198 @@ -281,17 +281,20 @@ directory is what people will see when they download your distribution and unpack it. -While performing the 'distdir' action, a file containing various bits -of "metadata" will be created. The metadata includes the module's -name, version, dependencies, license, and the C<dynamic_config> -flag. This file is created as F<META.yml> in YAML format, so you -must have the C<YAML> module installed in order to create it. You -should also ensure that the F<META.yml> file is listed in your -F<MANIFEST> - if it's not, a warning will be issued. - =item distmeta -Creates the F<META.yml> file for your distribution. +Creates the F<META.yml> file that describes the distribution. + +F<META.yml> is a file containing various bits of "metadata" about the +distribution. The metadata includes the distribution name, version, +abstract, prerequisites, license, and various other data about the +distribution. This file is created as F<META.yml> in YAML format, so +the C<YAML> module must be installed in order to create it. The +F<META.yml> file must also be listed in F<MANIFEST> - if it's not, a +warning will be issued. + +The current version of the F<META.yml> specification can be found at +L<http://module-build.sourceforge.net/META-spec-v1.2.html> =item distsign @@ -973,6 +976,9 @@ perl(1), Module::Build::Cookbook(3), Module::Build::Authoring(3), ExtUtils::MakeMaker(3), YAML(3) -http://www.dsmit.com/cons/ +F<META.yml> Specification: +L<http://module-build.sourceforge.net/META-spec-v1.2.html> + +L<http://www.dsmit.com/cons/> =cut |
From: Randy W. S. <si...@us...> - 2005-11-16 00:07:51
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv851/lib/Module/Build Modified Files: Authoring.pod Log Message: Move description of F<META.yml> from the 'distdir' action to 'distmeta'. Add links to currently supported version of the F<META.yml> specification. Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Authoring.pod 15 Nov 2005 22:37:50 -0000 1.22 +++ Authoring.pod 16 Nov 2005 00:07:42 -0000 1.23 @@ -1466,6 +1466,9 @@ perl(1), Module::Build(3), Module::Build::Cookbook(3), ExtUtils::MakeMaker(3), YAML(3) -http://www.dsmit.com/cons/ +F<META.yml> Specification: +L<http://module-build.sourceforge.net/META-spec-v1.2.html> + +L<http://www.dsmit.com/cons/> =cut |
From: Randy W. S. <si...@us...> - 2005-11-15 23:01:41
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21841/lib/Module Modified Files: Build.pm Log Message: Re-sort actions. Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.196 retrieving revision 1.197 diff -u -d -r1.196 -r1.197 --- Build.pm 15 Nov 2005 09:49:48 -0000 1.196 +++ Build.pm 15 Nov 2005 23:01:30 -0000 1.197 @@ -236,13 +236,6 @@ ... -=item prereq_report - -This action prints out a list of all prerequisites, the versions required, and -the versions actually installed. This can be useful for reviewing the -configuration of your system prior to a build, or when compiling data to send -for a bug report. - =item diff This action will compare the files about to be installed with their @@ -422,6 +415,13 @@ output, so you can supply C<tar> and/or C<gzip> parameters to affect the result. +=item prereq_report + +This action prints out a list of all prerequisites, the versions required, and +the versions actually installed. This can be useful for reviewing the +configuration of your system prior to a build, or when compiling data to send +for a bug report. + =item pure_install This action is identical to the C<install> action. In the future, |
From: Randy W. S. <si...@us...> - 2005-11-15 22:37:58
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17193/lib/Module/Build Modified Files: Authoring.pod Log Message: Fix broken section links. Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Authoring.pod 15 Nov 2005 09:49:48 -0000 1.21 +++ Authoring.pod 15 Nov 2005 22:37:50 -0000 1.22 @@ -178,7 +178,7 @@ the body of installed modules, and facilitates correct dependency checking on binary/packaged distributions of the module. -See the documentation for L<PREREQUISITES> for the details of how +See the documentation for L<"PREREQUISITES"> for the details of how requirements can be specified. =item c_source @@ -196,7 +196,7 @@ refuse to install the given module if the given module/version is also installed. -See the documentation for L<PREREQUISITES> for the details of how +See the documentation for L<"PREREQUISITES"> for the details of how requirements can be specified. =item create_makefile_pl @@ -579,7 +579,7 @@ modules aren't installed, and it should offer to install them if it wants to be helpful. -See the documentation for L<PREREQUISITES> for the details of how +See the documentation for L<"PREREQUISITES"> for the details of how requirements can be specified. =item requires @@ -602,7 +602,7 @@ preferred, but the C<prereq> term will remain valid in future distributions. -See the documentation for L<PREREQUISITES> for the details of how +See the documentation for L<"PREREQUISITES"> for the details of how requirements can be specified. =item script_files |
From: Randy W. S. <si...@us...> - 2005-11-15 09:49:56
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27267/lib/Module/Build Modified Files: Authoring.pod Base.pm Log Message: Remove action specific prereqs. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.519 retrieving revision 1.520 diff -u -d -r1.519 -r1.520 --- Base.pm 15 Nov 2005 05:43:27 -0000 1.519 +++ Base.pm 15 Nov 2005 09:49:48 -0000 1.520 @@ -30,9 +30,11 @@ $self->dist_name; $self->dist_version; + $self->check_manifest; $self->check_prereq; $self->check_autofeatures; + $self->_set_install_paths; $self->_find_nested_builds; @@ -156,7 +158,7 @@ $self->add_to_cleanup( @{delete $p->{add_to_cleanup}} ) if $p->{add_to_cleanup}; - + return $self; } @@ -175,6 +177,7 @@ } } + sub _set_install_paths { my $self = shift; my $c = $self->{config}; @@ -574,6 +577,14 @@ __PACKAGE__->add_property(metafile => 'META.yml'); __PACKAGE__->add_property(use_rcfile => 1); +{ + my @prereq_action_types = qw(requires build_requires conflicts recommends); + foreach my $type (@prereq_action_types) { + __PACKAGE__->add_property($type => {}); + } + __PACKAGE__->add_property(prereq_action_types => \@prereq_action_types); +} + __PACKAGE__->add_property($_) for qw( base_dir dist_name @@ -611,28 +622,9 @@ libdoc_dirs get_options quiet - ignore_prereq_conflicts - ignore_prereq_requires - ignore_prereqs prefix ); -{ - my @prereq_actions = ( 'Build_PL', __PACKAGE__->known_actions ); - my @prereq_types = qw( requires recommends conflicts ); - __PACKAGE__->add_property(prereq_actions => \@prereq_actions); - __PACKAGE__->add_property(prereq_types => \@prereq_types); - my @prereq_action_types; - foreach my $action ( @prereq_actions ) { - foreach my $type ( @prereq_types ) { - my $req = $action eq 'Build_PL' ? '' : $action . '_'; - $req .= $type; - __PACKAGE__->add_property( $req => {} ); - push( @prereq_action_types, $req ); - } - } - __PACKAGE__->add_property(prereq_action_types => \@prereq_action_types); -} sub mb_parents { # Code borrowed from Class::ISA. @@ -870,7 +862,7 @@ my $log_text; foreach my $type ( grep $failures->{$_}, @{$self->prereq_action_types} ) { while (my ($module, $status) = each %{$failures->{$type}}) { - my $prefix = ($type =~ /recommends$/) ? '*' : '-'; + my $prefix = ($type =~ /^(?:\w+_)?recommends$/) ? '*' : '-'; $log_text .= " $prefix $status->{message}\n"; } } @@ -885,8 +877,8 @@ sub prereq_failures { my ($self, $info) = @_; - my @types = @{ $self->prereq_action_types }; + my @types = @{ $self->prereq_action_types }; $info ||= {map {$_, $self->$_()} @types}; my $out; @@ -895,13 +887,13 @@ my $prereqs = $info->{$type}; while ( my ($modname, $spec) = each %$prereqs ) { my $status = $self->check_installed_status($modname, $spec); - - if ($type =~ /conflicts$/) { + + if ($type =~ /^(?:\w+_)?conflicts$/) { next if !$status->{ok}; $status->{conflicts} = delete $status->{need}; $status->{message} = "$modname ($status->{have}) conflicts with this distribution"; - } elsif ($type =~ /recommends$/) { + } elsif ($type =~ /^(?:\w+_)?recommends$/) { next if $status->{ok}; $status->{message} = ($status->{have} eq '<none>' ? "Optional prerequisite $modname is not installed" @@ -917,6 +909,19 @@ return $out; } +# returns a hash of defined prerequisites; i.e. only prereq types with values +sub _enum_prereqs { + my $self = shift; + my %prereqs; + foreach my $type ( @{ $self->prereq_action_types } ) { + if ( $self->can( $type ) ) { + my $prereq = $self->$type || {}; + $prereqs{$type} = $prereq if %$prereq; + } + } + return \%prereqs; +} + sub check_prereq { my $self = shift; @@ -928,20 +933,18 @@ } # Check to see if there are any prereqs to check - my $has_prereqs = grep { keys %{$self->$_()} } - @{ $self->prereq_action_types }; - return 1 unless $has_prereqs; + my $prereqs = $self->_enum_prereqs; + return 1 unless $prereqs; $self->log_info("Checking prerequisites...\n"); - my $failures = $self->prereq_failures; + my $failures = $self->prereq_failures($prereqs); if ( $failures ) { - foreach my $type ( @{$self->prereq_action_types} ) { - next unless $failures->{$type}; - while (my ($module, $status) = each %{$failures->{$type}}) { - my $prefix = ($type =~ /recommends$/) ? '*' : '- ERROR:'; + foreach my $fail ( sort keys( %$failures ) ) { + while (my ($module, $status) = each %{$failures->{$fail}}) { + my $prefix = ($fail =~ /^(?:\w+_)?recommends$/) ? '*' : '- ERROR:'; $self->log_warn(" $prefix $status->{message}\n"); } } @@ -1232,8 +1235,6 @@ sub _call_action { my ($self, $action) = @_; - $self->validate_action_prereqs( $action ); - return if $self->{_completed_actions}{$action}++; local $self->{action} = $action; @@ -1242,45 +1243,6 @@ return $self->$method(); } -sub validate_action_prereqs { - my $self = shift; - my $action = shift; - - return if $self->ignore_prereqs; - - my $failures = $self->prereq_failures; - my $fail_msg; - if ( !$self->ignore_prereq_requires && $failures->{"${action}_requires"} ) { - $fail_msg .= "Missing prerequisite module versions for action '$action':\n"; - foreach my $module ( keys( %{$failures->{"${action}_requires"}} ) ) { - my $fail_info = $failures->{"${action}_requires"}{$module}; - $fail_msg .= sprintf( " Requested module '%s %s%s' but found %s\n", - $module, - $fail_info->{need} !~ /^\s*[!=<>]/ ? '> ' : '', - $fail_info->{need}, - $fail_info->{have} ); - } - if ( $action eq 'build' ) { # Backwards compatability - $self->log_warn( "$fail_msg\n" . - "Ignoring for backwards compatability.\n" . - "This will be a fatal error in future versions of Module::Build.\n\n" ); - $fail_msg = undef; - } - } - if ( !$self->ignore_prereq_conflicts && $failures->{"${action}_conflicts"} ) { - $fail_msg .= "Found conflicting module requirements for action '$action':\n"; - foreach my $module ( keys( %{$failures->{"${action}_conflicts"}} ) ) { - my $fail_info = $failures->{"${action}_conflicts"}{$module}; - $fail_msg .= sprintf( " Requested module '%s %s%s' conflicts with installed version %s\n", - $module, - $fail_info->{conflicts} !~ /^\s*[!=<>]/ ? '> ' : '', - $fail_info->{conflicts}, - $fail_info->{have} ); - } - } - die "Aborting '$action' action.\n$fail_msg" if $fail_msg; -} - sub cull_options { my $self = shift; my $specs = $self->get_options or return ({}, @_); @@ -1346,9 +1308,6 @@ create_readme extra_compiler_flags extra_linker_flags - ignore_prereq_conflicts - ignore_prereq_requires - ignore_prereqs use_rcfile ); # normalize only selected option names @@ -1380,9 +1339,6 @@ create_readme pollute quiet - ignore_prereq_conflicts - ignore_prereq_requires - ignore_prereqs use_rcfile uninst ); Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Authoring.pod 13 Nov 2005 03:26:51 -0000 1.20 +++ Authoring.pod 15 Nov 2005 09:49:48 -0000 1.21 @@ -178,7 +178,7 @@ the body of installed modules, and facilitates correct dependency checking on binary/packaged distributions of the module. -See the documentation for L<requires> for the details of how +See the documentation for L<PREREQUISITES> for the details of how requirements can be specified. =item c_source @@ -196,7 +196,7 @@ refuse to install the given module if the given module/version is also installed. -See the documentation for L<requires> for the details of how +See the documentation for L<PREREQUISITES> for the details of how requirements can be specified. =item create_makefile_pl @@ -579,34 +579,13 @@ modules aren't installed, and it should offer to install them if it wants to be helpful. -See the documentation for L<requires> for the details of how +See the documentation for L<PREREQUISITES> for the details of how requirements can be specified. =item requires -An optional C<requires> argument specifies any module prerequisites that -the current module depends on. The prerequisites are given in a hash -reference, where the keys are the module names and the values are -version specifiers: - - requires => {Foo::Module => '2.4', - Bar::Module => 0, - Ken::Module => '>= 1.2, != 1.5, < 2.0', - perl => '5.6.0'}, - -These four version specifiers have different effects. The value -C<'2.4'> means that B<at least> version 2.4 of C<Foo::Module> must be -installed. The value C<0> means that B<any> version of C<Bar::Module> -is acceptable, even if C<Bar::Module> doesn't define a version. The -more verbose value C<'E<gt>= 1.2, != 1.5, E<lt> 2.0'> means that -C<Ken::Module>'s version must be B<at least> 1.2, B<less than> 2.0, -and B<not equal to> 1.5. The list of criteria is separated by commas, -and all criteria must be satisfied. - -A special C<perl> entry lets you specify the versions of the Perl -interpreter that are supported by your module. The same version -dependency-checking semantics are available, except that we also -understand perl's new double-dotted version numbers. +An optional C<requires> argument specifies any module prerequisites +that the current module depends on. One note: currently C<Module::Build> doesn't actually I<require> the user to have dependencies installed, it just strongly urges. In the @@ -623,6 +602,9 @@ preferred, but the C<prereq> term will remain valid in future distributions. +See the documentation for L<PREREQUISITES> for the details of how +requirements can be specified. + =item script_files An optional parameter specifying a set of files that should be @@ -1267,6 +1249,48 @@ =back +=head1 PREREQUISITES + +There are three basic types of prerequisites that can be defined: 1) +"requires" - are versions of modules that are required for certain +functionality to be available; 2) "recommends" - are versions of +modules that are recommended to provide enhanced functionality; and 3) +"conflicts" - are versions of modules that conflict with, and that can +cause problems with the distribution. + +Each of the three types of prerequisites listed above can be applied +to different aspects of the Build process. For the module distribution +itself you simply define "requires", "recommends", or "conflicts". The +types can also apply to other aspects of the Build process. Currently, +only "build_requires" is defined which is used for modules which are +required during the Build process. + + +=head2 Format of prerequisites + +The prerequisites are given in a hash reference, where the keys are +the module names and the values are version specifiers: + + requires => {Foo::Module => '2.4', + Bar::Module => 0, + Ken::Module => '>= 1.2, != 1.5, < 2.0', + perl => '5.6.0'}, + +These four version specifiers have different effects. The value +C<'2.4'> means that B<at least> version 2.4 of C<Foo::Module> must be +installed. The value C<0> means that B<any> version of C<Bar::Module> +is acceptable, even if C<Bar::Module> doesn't define a version. The +more verbose value C<'E<gt>= 1.2, != 1.5, E<lt> 2.0'> means that +C<Ken::Module>'s version must be B<at least> 1.2, B<less than> 2.0, +and B<not equal to> 1.5. The list of criteria is separated by commas, +and all criteria must be satisfied. + +A special C<perl> entry lets you specify the versions of the Perl +interpreter that are supported by your module. The same version +dependency-checking semantics are available, except that we also +understand perl's new double-dotted version numbers. + + =head1 SAVING CONFIGURATION INFORMATION Module::Build provides a very convenient way to save configuration @@ -1392,6 +1416,7 @@ See also the documentation for the C<subclass()> method. + =head1 STARTING MODULE DEVELOPMENT When starting development on a new module, it's rarely worth your time |
From: Randy W. S. <si...@us...> - 2005-11-15 09:49:56
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27267/lib/Module Modified Files: Build.pm Log Message: Remove action specific prereqs. Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.195 retrieving revision 1.196 diff -u -d -r1.195 -r1.196 --- Build.pm 13 Nov 2005 03:17:43 -0000 1.195 +++ Build.pm 15 Nov 2005 09:49:48 -0000 1.196 @@ -536,27 +536,12 @@ NOTE: There is some preliminary support for options to use the more familiar long option style. Most options can be preceded with the C<--> long option prefix, and the underscores changed to dashes -(e.g. --ignore-prereqs). Additionally, the argument to boolean options -is optional (e.g. --verbose), and boolean options can be negated by -prefixing them with 'no' or 'no-' (e.g. --noverbose or --no-verbose). +(e.g. --use-rcfile). Additionally, the argument to boolean options is +optional, and boolean options can be negated by prefixing them with +'no' or 'no-' (e.g. --noverbose or --no-verbose). =over 4 -=item ignore_prereq_conflicts - -When set to true, the Build will not abort when any conflicting -prerequisite is found. - -=item ignore_prereq_requires - -When set to true, the Build will not abort when any required -prerequisite is missing. - -=item ignore_prereqs - -When set to true, the Build will not abort for any type of -prerequisite is not satisfied. - =item quiet Suppress informative messages on output. |
From: Randy W. S. <si...@us...> - 2005-11-15 09:49:56
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27267 Modified Files: Changes Log Message: Remove action specific prereqs. Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.397 retrieving revision 1.398 diff -u -d -r1.397 -r1.398 --- Changes 13 Nov 2005 03:17:42 -0000 1.397 +++ Changes 15 Nov 2005 09:49:48 -0000 1.398 @@ -2,6 +2,11 @@ 0.27_04 + - Removed experimental feature that extended the prerequisite system + to apply ('requires', 'recommends', and 'conflicts') prereqs to all + actions. Most of the internal extensiblity has been retained so + that prereq types can easily be added, more selectively. + - Added a 'prereq_report' action that shows the user a well-formatted list of all prerequisites, the versions required, and the versions actually installed. [David Wheeler] @@ -240,13 +245,6 @@ - We now use ExtUtils::CBuilder to do all compiling of C code (for example, when compiling XS modules). - - Extend prerequisite specifications to apply to all actions. It is - now a fatal error if 'requires' or 'conflicts' for a given action - are not satisfied, except where necessary for backwards compatability. - Also, added '--force' options to ignore the fatal errors. (NOTE: - this is a somewhat experimental feature, we may morph this around a - bit before final release!) - - The creation of Unix man pages is no longer a strict necessity - it has now been turned into an 'auto-feature' contingent on the presence of Pod::Man and a location specified for man pages to go. |
From: Randy W. S. <si...@us...> - 2005-11-15 06:32:57
|
Update of /cvsroot/module-build/Module-Build/t/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28153/t/lib Modified Files: DistGen.pm Log Message: Be more persistent when unlinking files; Windows experiences very sporadic failures when unlinking. Index: DistGen.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/lib/DistGen.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- DistGen.pm 23 Sep 2005 02:34:19 -0000 1.12 +++ DistGen.pm 15 Nov 2005 06:32:49 -0000 1.13 @@ -217,7 +217,7 @@ my $real_filename = $self->_real_filename( $file ); my $fullname = File::Spec->catfile( $dist_dirname, $real_filename ); if ( -e $fullname ) { - unlink( $fullname ) || die "Couldn't unlink '$file'\n"; + 1 while unlink( $fullname ); } print "Unlinking pending file '$file'\n" if $VERBOSE; delete( $self->{pending}{remove}{$file} ); @@ -242,7 +242,7 @@ } if ( -e $fullname ) { - unlink( $fullname ) or die "Can't unlink '$file'\n"; + 1 while unlink( $fullname ); } my $fh = IO::File->new(">$fullname") or do { @@ -259,7 +259,7 @@ my $manifest = File::Spec->catfile( $dist_dirname, 'MANIFEST' ); unless ( $self->{skip_manifest} ) { if ( -e $manifest ) { - unlink( $manifest ) or die "Can't remove '$manifest'\n"; + 1 while unlink( $manifest ); } $self->_gen_manifest( $manifest ); } @@ -306,7 +306,7 @@ #print "Leaving file '$name'\n" if $VERBOSE; } else { print "Unlinking file '$name'\n" if $VERBOSE; - unlink( $_ ); + 1 while unlink( $_ ); } }, File::Spec->curdir ); |
From: Randy W. S. <si...@us...> - 2005-11-15 05:43:34
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21085/lib/Module/Build Modified Files: Base.pm Log Message: If the prerequisite type represents a conflict, label the table header to indicate that the expression in that column represents a clash when it is satisfied. Indicate failed prerequisites with a exclamation mark ("!") in the left column, before the module name. Reformat code to the two column indent standard used throughout Module::Build. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.518 retrieving revision 1.519 diff -u -d -r1.518 -r1.519 --- Base.pm 15 Nov 2005 01:50:26 -0000 1.518 +++ Base.pm 15 Nov 2005 05:43:27 -0000 1.519 @@ -1690,52 +1690,59 @@ } sub ACTION_prereq_report { - my $self = shift; - $self->log_info( $self->prereq_report ); + my $self = shift; + $self->log_info( $self->prereq_report ); } sub prereq_report { - my $self = shift; - my @types = @{ $self->prereq_action_types }; - my $info = { map { $_ => $self->$_() } @types }; + my $self = shift; + my @types = @{ $self->prereq_action_types }; + my $info = { map { $_ => $self->$_() } @types }; - my $output = ''; - foreach my $type (@types) { - my $prereqs = $info->{$type}; - next unless %$prereqs; - $output .= "\n$type:\n"; - my $mod_len = 2; - my $ver_len = 4; - my %mods; - while ( my ($modname, $spec) = each %$prereqs ) { - my $len = length $modname; - $mod_len = $len if $len > $mod_len; - $spec ||= '0'; - $len = length $spec; - $ver_len = $len if $len > $ver_len; - my $data = [ $modname => $spec ]; + my $output = ''; + foreach my $type (@types) { + my $prereqs = $info->{$type}; + next unless %$prereqs; + $output .= "\n$type:\n"; + my $mod_len = 2; + my $ver_len = 4; + my %mods; + while ( my ($modname, $spec) = each %$prereqs ) { + my $len = length $modname; + $mod_len = $len if $len > $mod_len; + $spec ||= '0'; + $len = length $spec; + $ver_len = $len if $len > $ver_len; - push @$data, $self->check_installed_status($modname, $spec)->{have}; - $mods{lc $modname} = $data; - } + my $mod = $self->check_installed_status($modname, $spec); + $mod->{name} = $modname; + $mod->{ok} ||= 0; + $mod->{ok} = ! $mod->{ok} if $type =~ /^(\w+_)?conflicts$/; - my $space = q{ } x ($mod_len - 3); - my $vspace = q{ } x ($ver_len - 3); - my $sline = q{-} x ($mod_len - 3); - my $vline = q{-} x ($ver_len - 3); - $output .= - " Module $space Need $vspace Have\n". - " ------$sline+------$vline-+----------\n"; + $mods{lc $modname} = $mod; + } - for my $k (sort keys %mods) { - my $data = $mods{$k}; - my $space = q{ } x ($mod_len - length $k); - my $vspace = q{ } x ($ver_len - length $data->[1]); - $output .= - " $data->[0] $space $data->[1] $vspace $data->[2]\n"; - } + my $space = q{ } x ($mod_len - 3); + my $vspace = q{ } x ($ver_len - 3); + my $sline = q{-} x ($mod_len - 3); + my $vline = q{-} x ($ver_len - 3); + my $disposition = ($type =~ /^(\w+_)?conflicts$/) ? + 'Clash' : 'Need'; + $output .= + " Module $space $disposition $vspace Have\n". + " ------$sline+------$vline-+----------\n"; + + + for my $k (sort keys %mods) { + my $mod = $mods{$k}; + my $space = q{ } x ($mod_len - length $k); + my $vspace = q{ } x ($ver_len - length $mod->{need}); + my $f = $mod->{ok} ? ' ' : '!'; + $output .= + " $f $mod->{name} $space $mod->{need} $vspace $mod->{have}\n"; } - return $output; + } + return $output; } sub ACTION_help { |
From: Ken W. <kwi...@us...> - 2005-11-15 01:50:37
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20519/lib/Module/Build Modified Files: Base.pm Log Message: Use check_installed_status() to check stuff's installed status in prereq_report() Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.517 retrieving revision 1.518 diff -u -d -r1.517 -r1.518 --- Base.pm 14 Nov 2005 07:07:16 -0000 1.517 +++ Base.pm 15 Nov 2005 01:50:26 -0000 1.518 @@ -1715,8 +1715,7 @@ $ver_len = $len if $len > $ver_len; my $data = [ $modname => $spec ]; - my $info = Module::Build::ModuleInfo->new_from_module($modname); - push @$data, $info ? $info->version : '[NONE]'; + push @$data, $self->check_installed_status($modname, $spec)->{have}; $mods{lc $modname} = $data; } |
From: Randy W. S. <si...@us...> - 2005-11-14 07:07:24
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15065/lib/Module/Build Modified Files: Base.pm Log Message: Change message to use language more consistent with option name. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.516 retrieving revision 1.517 diff -u -d -r1.516 -r1.517 --- Base.pm 14 Nov 2005 06:49:29 -0000 1.516 +++ Base.pm 14 Nov 2005 07:07:16 -0000 1.517 @@ -3269,7 +3269,7 @@ } $self->log_warn( - "WARNING: Can't figure out where to install file types: @skipping\n" . + "WARNING: Can't figure out install path for types: @skipping\n" . "Files will not be installed.\n" ) if @skipping; |
From: Randy W. S. <si...@us...> - 2005-11-14 06:49:37
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12472/lib/Module/Build Modified Files: Base.pm Log Message: When documentation actions are invoked implicitly, ensure that they generate documentation only if a default setup where Config.pm provides the install configuration or if the user has setup the configuration manually with by install-path. This ensures consistency between the default install configuration and installs using install-base or prefix. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.515 retrieving revision 1.516 diff -u -d -r1.515 -r1.516 --- Base.pm 14 Nov 2005 05:47:58 -0000 1.515 +++ Base.pm 14 Nov 2005 06:49:29 -0000 1.516 @@ -2134,6 +2134,19 @@ $self->depends_on('manpages', 'html'); } +# Given a file type, will return true if the file type would normally +# be installed when neither install-base nor prefix has been set. +# I.e. it will be true only if the path is set from Config.pm or +# set explicitly by the user via install-path. +sub _is_default_installable { + my $self = shift; + my $type = shift; + return ( $self->install_destination($type) && + ( $self->install_path->{$type} || + $self->install_sets->{$self->installdirs}{$type} ) + ) ? 1 : 0; +} + sub ACTION_manpages { my $self = shift; @@ -2151,7 +2164,7 @@ if ( $self->invoked_action eq 'manpages' ) { $self->$sub(); - } elsif ( $self->install_destination("${type}doc") ) { + } elsif ( $self->_is_default_installable("${type}doc") ) { $self->$sub(); } } @@ -2241,7 +2254,7 @@ if ( $self->invoked_action eq 'html' ) { $self->htmlify_pods( $type ); - } elsif ( $self->install_destination("${type}html") ) { + } elsif ( $self->_is_default_installable("${type}html") ) { $self->htmlify_pods( $type ); } } |
From: Randy W. S. <si...@us...> - 2005-11-14 05:48:06
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29868/lib/Module/Build Modified Files: Base.pm Log Message: Structure manpage and html document (collectively documentation) processing so that documentation is not generated unless there is a place to install it. Generation of documentation can be forced by invoking the respective action ('manpages' or 'html') explicitly or setting the appropriate install-path, install-base, or prefix. Regardless, documentation (and any other file type) will not be installed unless there are files of that type and there is a place to install them; if not, a warning will be issued. Setup some tests so that a known, predictable configuration is used in construction of Module::Build objects in order to reliably check install paths. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.514 retrieving revision 1.515 diff -u -d -r1.514 -r1.515 --- Base.pm 13 Nov 2005 03:26:51 -0000 1.514 +++ Base.pm 14 Nov 2005 05:47:58 -0000 1.515 @@ -185,8 +185,11 @@ my $arch = $c->{archname}; my $version = $c->{version}; - my $html1dir = $c->{installhtml1dir} || $c->{installhtmldir}; - my $html3dir = $c->{installhtml3dir} || $c->{installhtmldir}; + my $bindoc = $c->{installman1dir} || undef; + my $libdoc = $c->{installman3dir} || undef; + + my $binhtml = $c->{installhtml1dir} || $c->{installhtmldir} || undef; + my $libhtml = $c->{installhtml3dir} || $c->{installhtmldir} || undef; $p->{install_sets} = { @@ -195,10 +198,10 @@ arch => $c->{installarchlib}, bin => $c->{installbin}, script => $c->{installscript}, - bindoc => $c->{installman1dir}, - libdoc => $c->{installman3dir}, - binhtml => $html1dir, - libhtml => $html3dir, + bindoc => $bindoc, + libdoc => $libdoc, + binhtml => $binhtml, + libhtml => $libhtml, }, site => { lib => $c->{installsitelib}, @@ -206,10 +209,10 @@ bin => $c->{installsitebin} || $c->{installbin}, script => $c->{installsitescript} || $c->{installsitebin} || $c->{installscript}, - bindoc => $c->{installsiteman1dir} || $c->{installman1dir}, - libdoc => $c->{installsiteman3dir} || $c->{installman3dir}, - binhtml => $c->{installsitehtml1dir} || $html1dir, - libhtml => $c->{installsitehtml3dir} || $html3dir, + bindoc => $c->{installsiteman1dir} || $bindoc, + libdoc => $c->{installsiteman3dir} || $libdoc, + binhtml => $c->{installsitehtml1dir} || $binhtml, + libhtml => $c->{installsitehtml3dir} || $libhtml, }, vendor => { lib => $c->{installvendorlib}, @@ -217,10 +220,10 @@ bin => $c->{installvendorbin} || $c->{installbin}, script => $c->{installvendorscript} || $c->{installvendorbin} || $c->{installscript}, - bindoc => $c->{installvendorman1dir} || $c->{installman1dir}, - libdoc => $c->{installvendorman3dir} || $c->{installman3dir}, - binhtml => $c->{installvendorhtml1dir} || $html1dir, - libhtml => $c->{installvendorhtml3dir} || $html3dir, + bindoc => $c->{installvendorman1dir} || $bindoc, + libdoc => $c->{installvendorman3dir} || $libdoc, + binhtml => $c->{installvendorhtml1dir} || $binhtml, + libhtml => $c->{installvendorhtml3dir} || $libhtml, }, }; @@ -2136,19 +2139,23 @@ return unless $self->_mb_feature('manpage_support'); - if ( $self->invoked_action ne 'manpages' ) { - foreach my $type ( qw(bin lib) ) { - my $files = $self->_find_pods( $self->{properties}{"${type}doc_dirs"}, - exclude => [ qr/\.bat$/ ] ); - return if %$files && !$self->install_destination("${type}doc"); + $self->depends_on('code'); + + foreach my $type ( qw(bin lib) ) { + my $files = $self->_find_pods( $self->{properties}{"${type}doc_dirs"}, + exclude => [ qr/\.bat$/ ] ); + next unless %$files; + my $sub = $self->can("manify_${type}_pods"); + next unless defined( $sub ); + + if ( $self->invoked_action eq 'manpages' ) { + $self->$sub(); + } elsif ( $self->install_destination("${type}doc") ) { + $self->$sub(); } } - $self->depends_on('code'); - - $self->manify_bin_pods; - $self->manify_lib_pods; } sub manify_bin_pods { @@ -2225,17 +2232,20 @@ return unless $self->_mb_feature('HTML_support'); - if ( $self->invoked_action ne 'html' ) { - foreach my $type ( qw(bin lib) ) { - my $files = $self->_find_pods( $self->{properties}{"${type}doc_dirs"}, - exclude => [ qr/\.(?:bat|com|html)$/ ] ); - return if %$files && !$self->install_destination("${type}html"); + $self->depends_on('code'); + + foreach my $type ( qw(bin lib) ) { + my $files = $self->_find_pods( $self->{properties}{"${type}doc_dirs"}, + exclude => [ qr/\.(?:bat|com|html)$/ ] ); + next unless %$files; + + if ( $self->invoked_action eq 'html' ) { + $self->htmlify_pods( $type ); + } elsif ( $self->install_destination("${type}html") ) { + $self->htmlify_pods( $type ); } } - $self->depends_on('code'); - - $self->htmlify_pods; } @@ -2246,77 +2256,74 @@ # 3) Links to other modules are not being generated sub htmlify_pods { my $self = shift; + my $type = shift; require Module::Build::PodParser; require Pod::Html; $self->add_to_cleanup('pod2htm*'); - foreach my $type ( qw(bin lib) ) { - - my $pods = $self->_find_pods( $self->{properties}{"${type}doc_dirs"}, - exclude => [ qr/\.(?:bat|com|html)$/ ] ); - next unless %$pods; # nothing to do - - my $podpath = join ':', - map $_->[1], - grep -e $_->[0], - map [File::Spec->catdir($self->blib, $_), $_], - qw( script lib ); + my $pods = $self->_find_pods( $self->{properties}{"${type}doc_dirs"}, + exclude => [ qr/\.(?:bat|com|html)$/ ] ); + next unless %$pods; # nothing to do - my $htmldir = File::Spec->catdir($self->blib, "${type}html"); - unless ( -d $htmldir ) { - File::Path::mkpath($htmldir, 0, 0755) - or die "Couldn't mkdir $htmldir: $!"; - } + my $podpath = join ':', + map $_->[1], + grep -e $_->[0], + map [File::Spec->catdir($self->blib, $_), $_], + qw( script lib ); - my @rootdirs = ($type eq 'bin') ? qw(bin) : qw(site lib); + my $htmldir = File::Spec->catdir($self->blib, "${type}html"); + unless ( -d $htmldir ) { + File::Path::mkpath($htmldir, 0, 0755) + or die "Couldn't mkdir $htmldir: $!"; + } - foreach my $pod ( keys %$pods ) { + my @rootdirs = ($type eq 'bin') ? qw(bin) : qw(site lib); - my ($name, $path) = File::Basename::fileparse($pods->{$pod}, qr{\..*}); - my @dirs = File::Spec->splitdir( File::Spec->canonpath( $path ) ); - pop( @dirs ) if $dirs[-1] eq File::Spec->curdir; + foreach my $pod ( keys %$pods ) { - my $fulldir = File::Spec->catfile($htmldir, @rootdirs, @dirs); - my $outfile = File::Spec->catfile($fulldir, "${name}.html"); - my $infile = File::Spec->abs2rel($pod); + my ($name, $path) = File::Basename::fileparse($pods->{$pod}, qr{\..*}); + my @dirs = File::Spec->splitdir( File::Spec->canonpath( $path ) ); + pop( @dirs ) if $dirs[-1] eq File::Spec->curdir; - next if $self->up_to_date($infile, $outfile); + my $fulldir = File::Spec->catfile($htmldir, @rootdirs, @dirs); + my $outfile = File::Spec->catfile($fulldir, "${name}.html"); + my $infile = File::Spec->abs2rel($pod); - unless ( -d $fulldir ){ - File::Path::mkpath($fulldir, 0, 0755) - or die "Couldn't mkdir $fulldir: $!"; - } + next if $self->up_to_date($infile, $outfile); - my $path2root = join( '/', ('..') x (@rootdirs+@dirs) ); - my $htmlroot = "$path2root/site"; + unless ( -d $fulldir ){ + File::Path::mkpath($fulldir, 0, 0755) + or die "Couldn't mkdir $fulldir: $!"; + } - my $fh = IO::File->new($infile); - my $abstract = Module::Build::PodParser->new(fh => $fh)->get_abstract(); + my $path2root = join( '/', ('..') x (@rootdirs+@dirs) ); + my $htmlroot = "$path2root/site"; - my $title = join( '::', (@dirs, $name) ); - $title .= " - $abstract" if $abstract; + my $fh = IO::File->new($infile); + my $abstract = Module::Build::PodParser->new(fh => $fh)->get_abstract(); + my $title = join( '::', (@dirs, $name) ); + $title .= " - $abstract" if $abstract; - my @opts = ( - '--flush', - "--title=$title", - "--podpath=$podpath", - "--infile=$infile", - "--outfile=$outfile", - '--podroot=' . $self->blib, - "--htmlroot=$htmlroot", - eval {Pod::Html->VERSION(1.03); 1} ? - ('--header', '--backlink=Back to Top') : (), - ); + my @opts = ( + '--flush', + "--title=$title", + "--podpath=$podpath", + "--infile=$infile", + "--outfile=$outfile", + '--podroot=' . $self->blib, + "--htmlroot=$htmlroot", + eval {Pod::Html->VERSION(1.03); 1} ? + ('--header', '--backlink=Back to Top') : (), + ); - push( @opts, "--css=$path2root/". $self->html_css ) if $self->html_css; + push( @opts, "--css=$path2root/". $self->html_css ) if $self->html_css; - $self->log_info("HTMLifying $infile -> $outfile\n"); - $self->log_verbose("pod2html @opts\n"); - Pod::Html::pod2html(@opts); # or warn "pod2html @opts failed: $!"; - } + $self->log_info("HTMLifying $infile -> $outfile\n"); + $self->log_verbose("pod2html @opts\n"); + Pod::Html::pod2html(@opts); # or warn "pod2html @opts failed: $!"; } } @@ -3144,8 +3151,10 @@ my ($self, $type) = @_; my $installdirs = $self->installdirs; - return $self->_prefixify($self->install_sets->{$installdirs}{$type}, - $self->original_prefix->{$installdirs}, + my $relpath = $self->install_sets->{$installdirs}{$type}; + + return $self->_prefixify($relpath, + $self->original_prefix->{$installdirs}, $type, ); } @@ -3208,10 +3217,19 @@ sub install_destination { my ($self, $type) = @_; - + return $self->install_path->{$type} if exists $self->install_path->{$type}; - return File::Spec->catdir($self->install_base, $self->install_base_relpaths($type)) if $self->install_base; - return File::Spec->catdir($self->prefix, $self->prefix_relative($type)) if $self->prefix; + + if ( $self->install_base ) { + my $relpath = $self->install_base_relpaths($type); + return $relpath ? File::Spec->catdir($self->install_base, $relpath) : undef; + } + + if ( $self->prefix ) { + my $relpath = $self->prefix_relative($type); + return $relpath ? File::Spec->catdir($self->prefix, $relpath) : undef; + } + return $self->install_sets->{ $self->installdirs }{$type}; } @@ -3225,20 +3243,22 @@ my ($self, $blib) = @_; $blib ||= $self->blib; - my %map; + my( %map, @skipping ); foreach my $type ($self->install_types) { my $localdir = File::Spec->catdir( $blib, $type ); next unless -e $localdir; - + if (my $dest = $self->install_destination($type)) { $map{$localdir} = $dest; } else { - # Platforms like Win32, MacOS, etc. may not build man pages & - # Many platforms don't supply default locations for html docs - die "Can't figure out where to install things of type '$type'" - unless $type =~ /^(lib|bin)(doc|html)$/; + push( @skipping, $type ); } } + + $self->log_warn( + "WARNING: Can't figure out where to install file types: @skipping\n" . + "Files will not be installed.\n" + ) if @skipping; # Write the packlist into the same place as ExtUtils::MakeMaker. my $archdir = $self->install_destination('arch'); |
From: Randy W. S. <si...@us...> - 2005-11-14 05:48:06
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29868/t Modified Files: destinations.t install.t manifypods.t Log Message: Structure manpage and html document (collectively documentation) processing so that documentation is not generated unless there is a place to install it. Generation of documentation can be forced by invoking the respective action ('manpages' or 'html') explicitly or setting the appropriate install-path, install-base, or prefix. Regardless, documentation (and any other file type) will not be installed unless there are files of that type and there is a place to install them; if not, a warning will be issued. Setup some tests so that a known, predictable configuration is used in construction of Module::Build objects in order to reliably check install paths. Index: manifypods.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/manifypods.t,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- manifypods.t 2 Oct 2005 05:26:07 -0000 1.16 +++ manifypods.t 14 Nov 2005 05:47:58 -0000 1.17 @@ -64,16 +64,25 @@ chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; - -my $destdir = File::Spec->catdir($cwd, 't', 'install_test'); +use File::Spec::Functions qw( catdir ); +my $destdir = catdir($cwd, 't', 'install_test'); my $mb = Module::Build->new( module_name => $dist->name, install_base => $destdir, - gen_manpages => 1, # some platforms don't by default scripts => [ File::Spec->catfile( 'bin', 'nopod.pl' ), File::Spec->catfile( 'bin', 'haspod.pl' ) ], + + # need default install paths to ensure manpages & HTML get generated + installdirs => 'site', + config => { + installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'), + installsiteman3dir => catdir($tmp, 'site', 'man', 'man3'), + installsitehtml1dir => catdir($tmp, 'site', 'html'), + installsitehtml3dir => catdir($tmp, 'site', 'html'), + } + ); $mb->add_to_cleanup($destdir); Index: install.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/install.t,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- install.t 20 Oct 2005 16:45:19 -0000 1.27 +++ install.t 14 Nov 2005 05:47:58 -0000 1.28 @@ -44,7 +44,26 @@ --- $dist->regen; -my $mb = Module::Build->new_from_context; + +use File::Spec::Functions qw( catdir ); + +my $mb = Module::Build->new_from_context( + # need default install paths to ensure manpages & HTML get generated + installdirs => 'site', + config => { + installman1dir => catdir($tmp, 'man', 'man1'), + installman3dir => catdir($tmp, 'man', 'man3'), + installhtml1dir => catdir($tmp, 'html'), + installhtml3dir => catdir($tmp, 'html'), + + installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'), + installsiteman3dir => catdir($tmp, 'site', 'man', 'man3'), + installsitehtml1dir => catdir($tmp, 'site', 'html'), + installsitehtml3dir => catdir($tmp, 'site', 'html'), + } + +); + ok $mb; Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- destinations.t 20 Oct 2005 16:45:19 -0000 1.34 +++ destinations.t 14 Nov 2005 05:47:58 -0000 1.35 @@ -27,15 +27,42 @@ ######################### +# We need to create a well defined environment to test install paths. +# We do this by setting up appropriate Config entries. + use Module::Build; -my $mb = Module::Build->new_from_context; +my @installstyle = qw(lib perl5); +my $mb = Module::Build->new_from_context( + installdirs => 'site', + config => { + installstyle => catdir(@installstyle), + + installprivlib => catdir($tmp, @installstyle), + installarchlib => catdir($tmp, @installstyle, + @Config{qw(version archname)}), + installbin => catdir($tmp, 'bin'), + installscript => catdir($tmp, 'bin'), + installman1dir => catdir($tmp, 'man', 'man1'), + installman3dir => catdir($tmp, 'man', 'man3'), + installhtml1dir => catdir($tmp, 'html'), + installhtml3dir => catdir($tmp, 'html'), + + installsitelib => catdir($tmp, 'site', @installstyle, 'site_perl'), + installsitearch => catdir($tmp, 'site', @installstyle, 'site_perl', + @Config{qw(version archname)}), + installsitebin => catdir($tmp, 'site', 'bin'), + installsitescript => catdir($tmp, 'site', 'bin'), + installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'), + installsiteman3dir => catdir($tmp, 'site', 'man', 'man3'), + installsitehtml1dir => catdir($tmp, 'site', 'html'), + installsitehtml3dir => catdir($tmp, 'site', 'html'), + } +); isa_ok( $mb, 'Module::Build::Base' ); my $install_sets = $mb->install_sets; - # Get us into a known state. -$mb->installdirs('site'); $mb->install_base(undef); $mb->prefix(undef); @@ -47,17 +74,15 @@ is( $mb->prefix, undef ); test_install_destinations( $mb, { - lib => $Config{installsitelib}, - arch => $Config{installsitearch}, - bin => $Config{installsitebin} || $Config{installbin}, - script => $Config{installsitescript} || $Config{installsitebin} || - $Config{installscript}, - bindoc => $Config{installsiteman1dir} || $Config{installman1dir}, - libdoc => $Config{installsiteman3dir} || $Config{installman3dir}, - binhtml => $Config{installsitehtml1dir} || - $Config{installhtml1dir} || $Config{installhtmldir}, - libhtml => $Config{installsitehtml3dir} || - $Config{installhtml3dir} || $Config{installhtmldir}, + lib => catdir($tmp, 'site', @installstyle, 'site_perl'), + arch => catdir($tmp, 'site', @installstyle, 'site_perl', + @Config{qw(version archname)}), + bin => catdir($tmp, 'site', 'bin'), + script => catdir($tmp, 'site', 'bin'), + bindoc => catdir($tmp, 'site', 'man', 'man1'), + libdoc => catdir($tmp, 'site', 'man', 'man3'), + binhtml => catdir($tmp, 'site', 'html'), + libhtml => catdir($tmp, 'site', 'html'), }); } @@ -68,14 +93,14 @@ is( $mb->installdirs, 'core' ); test_install_destinations( $mb, { - lib => $Config{installprivlib}, - arch => $Config{installarchlib}, - bin => $Config{installbin}, - script => $Config{installscript} || $Config{installbin}, - bindoc => $Config{installman1dir}, - libdoc => $Config{installman3dir}, - binhtml => $Config{installhtml1dir} || $Config{installhtmldir}, - libhtml => $Config{installhtml3dir} || $Config{installhtmldir}, + lib => catdir($tmp, @installstyle), + arch => catdir($tmp, @installstyle, @Config{qw(version archname)}), + bin => catdir($tmp, 'bin'), + script => catdir($tmp, 'bin'), + bindoc => catdir($tmp, 'man', 'man1'), + libdoc => catdir($tmp, 'man', 'man3'), + binhtml => catdir($tmp, 'html'), + libhtml => catdir($tmp, 'html'), }); $mb->installdirs('site'); |
From: Ken W. <kwi...@us...> - 2005-11-14 03:05:21
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6163/lib/Module/Build Modified Files: Compat.pm Log Message: Yet again, fix the abs->rel translation of 'use lib' for a custom subclass Index: Compat.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Compat.pm,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- Compat.pm 24 Oct 2005 12:34:30 -0000 1.69 +++ Compat.pm 14 Nov 2005 03:05:13 -0000 1.70 @@ -49,9 +49,13 @@ if (File::Spec->file_name_is_absolute($subclass_dir)) { my $base_dir = $build->base_dir; - $build->log_warn("Warning: builder subclass " . ref($build) . - " doesn't seem to have been loaded from within $base_dir") - unless $build->dir_contains($base_dir, $subclass_dir); + + if ($build->dir_contains($base_dir, $subclass_dir)) { + $subclass_dir = File::Spec->abs2rel($subclass_dir, $base_dir); + } else { + $build->log_warn("Warning: builder subclass " . ref($build) . + " doesn't seem to have been loaded from within $base_dir"); + } } $subclass_load = "use lib '$subclass_dir';"; } |
From: Ken W. <kwi...@us...> - 2005-11-13 03:26:58
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19403/lib/Module/Build Modified Files: Authoring.pod Base.pm Log Message: Add a prereq_report() method that implements the guts of the prereq_report action Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.513 retrieving revision 1.514 diff -u -d -r1.513 -r1.514 --- Base.pm 13 Nov 2005 03:17:44 -0000 1.513 +++ Base.pm 13 Nov 2005 03:26:51 -0000 1.514 @@ -1688,13 +1688,19 @@ sub ACTION_prereq_report { my $self = shift; + $self->log_info( $self->prereq_report ); +} + +sub prereq_report { + my $self = shift; my @types = @{ $self->prereq_action_types }; my $info = { map { $_ => $self->$_() } @types }; + my $output = ''; foreach my $type (@types) { my $prereqs = $info->{$type}; next unless %$prereqs; - $self->log_info("\n$type:\n"); + $output .= "\n$type:\n"; my $mod_len = 2; my $ver_len = 4; my %mods; @@ -1715,20 +1721,19 @@ my $vspace = q{ } x ($ver_len - 3); my $sline = q{-} x ($mod_len - 3); my $vline = q{-} x ($ver_len - 3); - $self->log_info( - " Module $space Need $vspace Have\n", - " ------$sline+------$vline-+----------\n", - ); + $output .= + " Module $space Need $vspace Have\n". + " ------$sline+------$vline-+----------\n"; for my $k (sort keys %mods) { my $data = $mods{$k}; my $space = q{ } x ($mod_len - length $k); my $vspace = q{ } x ($ver_len - length $data->[1]); - $self->log_info( - " $data->[0] $space $data->[1] $vspace $data->[2]\n" - ); + $output .= + " $data->[0] $space $data->[1] $vspace $data->[2]\n"; } } + return $output; } sub ACTION_help { Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Authoring.pod 5 Nov 2005 15:48:55 -0000 1.19 +++ Authoring.pod 13 Nov 2005 03:26:51 -0000 1.20 @@ -1177,6 +1177,15 @@ } } +=item prereq_report() + +Returns a human-readable (table-form) string showing all +prerequisites, the versions required, and the versions actually +installed. This can be useful for reviewing the configuration of your +system prior to a build, or when compiling data to send for a bug +report. The C<prereq_report> action is just a thin wrapper around the +C<prereq_report()> method. + =item prompt($message, $default) Asks the user a question and returns their response as a string. The |
From: Ken W. <kwi...@us...> - 2005-11-13 03:17:52
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18178/lib/Module/Build Modified Files: Base.pm Log Message: Add the prereq_report action Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.512 retrieving revision 1.513 diff -u -d -r1.512 -r1.513 --- Base.pm 2 Nov 2005 01:36:01 -0000 1.512 +++ Base.pm 13 Nov 2005 03:17:44 -0000 1.513 @@ -1686,6 +1686,51 @@ return join '', @docs; } +sub ACTION_prereq_report { + my $self = shift; + my @types = @{ $self->prereq_action_types }; + my $info = { map { $_ => $self->$_() } @types }; + + foreach my $type (@types) { + my $prereqs = $info->{$type}; + next unless %$prereqs; + $self->log_info("\n$type:\n"); + my $mod_len = 2; + my $ver_len = 4; + my %mods; + while ( my ($modname, $spec) = each %$prereqs ) { + my $len = length $modname; + $mod_len = $len if $len > $mod_len; + $spec ||= '0'; + $len = length $spec; + $ver_len = $len if $len > $ver_len; + my $data = [ $modname => $spec ]; + + my $info = Module::Build::ModuleInfo->new_from_module($modname); + push @$data, $info ? $info->version : '[NONE]'; + $mods{lc $modname} = $data; + } + + my $space = q{ } x ($mod_len - 3); + my $vspace = q{ } x ($ver_len - 3); + my $sline = q{-} x ($mod_len - 3); + my $vline = q{-} x ($ver_len - 3); + $self->log_info( + " Module $space Need $vspace Have\n", + " ------$sline+------$vline-+----------\n", + ); + + for my $k (sort keys %mods) { + my $data = $mods{$k}; + my $space = q{ } x ($mod_len - length $k); + my $vspace = q{ } x ($ver_len - length $data->[1]); + $self->log_info( + " $data->[0] $space $data->[1] $vspace $data->[2]\n" + ); + } + } +} + sub ACTION_help { my ($self) = @_; my $actions = $self->known_actions; @@ -3195,7 +3240,8 @@ my @ext = split /::/, $self->module_name; $map{write} = File::Spec->catdir($archdir, 'auto', @ext, '.packlist'); - if (length(my $destdir = $self->{properties}{destdir} || '')) { + # Handle destdir + if (length(my $destdir = $self->destdir || '')) { foreach (keys %map) { # Need to remove volume from $map{$_} using splitpath, or else # we'll create something crazy like C:\Foo\Bar\E:\Baz\Quux |
From: Ken W. <kwi...@us...> - 2005-11-13 03:17:52
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18178/lib/Module Modified Files: Build.pm Log Message: Add the prereq_report action Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.194 retrieving revision 1.195 diff -u -d -r1.194 -r1.195 --- Build.pm 5 Nov 2005 01:56:07 -0000 1.194 +++ Build.pm 13 Nov 2005 03:17:43 -0000 1.195 @@ -236,6 +236,13 @@ ... +=item prereq_report + +This action prints out a list of all prerequisites, the versions required, and +the versions actually installed. This can be useful for reviewing the +configuration of your system prior to a build, or when compiling data to send +for a bug report. + =item diff This action will compare the files about to be installed with their |
From: Ken W. <kwi...@us...> - 2005-11-13 03:17:51
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18178 Modified Files: Changes Log Message: Add the prereq_report action Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.396 retrieving revision 1.397 diff -u -d -r1.396 -r1.397 --- Changes 1 Nov 2005 09:58:37 -0000 1.396 +++ Changes 13 Nov 2005 03:17:42 -0000 1.397 @@ -2,6 +2,10 @@ 0.27_04 + - Added a 'prereq_report' action that shows the user a well-formatted + list of all prerequisites, the versions required, and the versions + actually installed. [David Wheeler] + - Add an invoked_action() method to return the name of the original action invoked by the user. |
From: Ken W. <kwi...@us...> - 2005-11-05 15:58:20
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10436/t Modified Files: metadata.t Log Message: Small style tweak, add parens Index: metadata.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata.t,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- metadata.t 1 Nov 2005 08:04:33 -0000 1.8 +++ metadata.t 5 Nov 2005 15:58:13 -0000 1.9 @@ -90,7 +90,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => {file => 'lib/Simple.pm', version => '1.23'}}); @@ -99,7 +99,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => {file => 'lib/Simple.pm'}}); @@ -111,7 +111,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Foo::Bar' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -120,7 +120,7 @@ package Foo::Bar; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Foo::Bar' => { file => 'lib/Simple.pm'}}); @@ -136,7 +136,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }, @@ -155,7 +155,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Foo' => { file => 'lib/Simple.pm', version => '1.23' }, @@ -173,7 +173,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm' }}); @@ -189,7 +189,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -206,7 +206,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -224,7 +224,7 @@ --- $dist->regen( clean => 1 ); my $err = ''; -$err = stderr_of( sub { $mb = new_build } ); +$err = stderr_of( sub { $mb = new_build() } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -243,7 +243,7 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$err = stderr_of( sub { $mb = new_build } ); +$err = stderr_of( sub { $mb = new_build() } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Foo' => { file => 'lib/Simple.pm', @@ -265,7 +265,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -283,7 +283,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -303,7 +303,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple2.pm', version => '1.23' }}); @@ -323,7 +323,7 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -346,7 +346,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -370,7 +370,7 @@ package Foo; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); $provides = $mb->find_dist_packages; ok( exists( $provides->{Foo} ) ); # it exist, can't predict which file $dist->remove_file( 'lib/Simple2.pm' ); @@ -388,7 +388,7 @@ package Foo; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Foo' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -407,7 +407,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Foo' => { file => 'lib/Simple2.pm', version => '1.23' }}); @@ -427,7 +427,7 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); # XXX Should 'Foo' exist ??? Can't predict values for file & version ok( exists( $provides->{Foo} ) ); @@ -449,7 +449,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); ok( exists( $provides->{Foo} ) ); is( $provides->{Foo}{version}, '1.23' ); @@ -475,7 +475,7 @@ --- $dist->regen( clean => 1 ); $err = stderr_of( sub { - $mb = new_build; + $mb = new_build(); } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, @@ -501,7 +501,7 @@ --- $dist->regen( clean => 1 ); $err = stderr_of( sub { - $mb = new_build; + $mb = new_build(); } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, @@ -527,7 +527,7 @@ $VERSION = '3.45'; --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -540,7 +540,7 @@ $dist->change_file( 'lib/Simple.pm', '' ); $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply( $mb->find_dist_packages, {} ); # Simple.pm => =pod..=cut (no package declaration) @@ -558,7 +558,7 @@ =cut --- $dist->regen( clean => 1 ); -$mb = new_build; +$mb = new_build(); is_deeply($mb->find_dist_packages, {}); |
From: Ken W. <kwi...@us...> - 2005-11-05 15:49:03
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8587/lib/Module/Build Modified Files: Authoring.pod Log Message: Tweaks to dispatch() and depends_on() docs Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Authoring.pod 3 Nov 2005 01:15:16 -0000 1.18 +++ Authoring.pod 5 Nov 2005 15:48:55 -0000 1.19 @@ -929,12 +929,19 @@ Invokes the named action or list of actions in sequence. Using this method is preferred to calling the action explicitly because it performs some internal record-keeping, and it ensures that the same -action is not invoked multiple times. +action is not invoked multiple times (note: in future versions of +Module::Build it's conceivable that this run-only-once mechanism will +be changed to something more intelligent). -This method is intended to be used by Module::Build subclasses when -defining custom actions that depend on other sub-actions. If you need -to invoke an action outside of the build process, see L<dispatch> -below. +Note that the name of this method is something of a misnomer; it +should really be called something like +C<invoke_actions_unless_already_invoked()> or something, but for +better or worse (perhaps better!) we were still thinking in +C<make>-like dependency terms when we created this method. + +See also C<dispatch()>. The main distinction between the two is that +C<depends_on()> is meant to call an action from inside another action, +whereas C<dispatch()> is meant to set the very top action in motion. =item dir_contains($first_dir, $second_dir) @@ -955,15 +962,12 @@ $mb->dispatch('foo', verbose => 1, args => { my_option => 'value' }); This method is intended to be used to programmatically invoke build -actions. I.e. It's primarily to be used by applications controlling -Module::Build based builds rather than by subclasses. If you need to -invoke an action from within a F<Build.PL> script or a subclass, see -L<depends_on> above. +actions, e.g. by applications controlling Module::Build-based builds +rather than by subclasses. -Unlike C<< depends_on() >>, this method resets the list of previously -invoked actions, so actions in a previous C<< dispatch() >> call will -be invoked again in subsequent calls. However, within a single call -actions are still run only a single time. +See also C<depends_on()>. The main distinction between the two is that +C<depends_on()> is meant to call an action from inside another action, +whereas C<dispatch()> is meant to set the very top action in motion. =item dist_dir() |
From: Ken W. <kwi...@us...> - 2005-11-05 01:56:17
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25437/lib/Module Modified Files: Build.pm Log Message: We do this now Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.193 retrieving revision 1.194 diff -u -d -r1.193 -r1.194 --- Build.pm 3 Nov 2005 01:08:31 -0000 1.193 +++ Build.pm 5 Nov 2005 01:56:07 -0000 1.194 @@ -951,7 +951,6 @@ signature or the like, if available. See C<cons> for an example. - append to perllocal.pod - - write .packlist in appropriate location (needed for un-install) - add a 'plugin' functionality |
From: Randy W. S. <si...@us...> - 2005-11-03 01:15:25
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5066/lib/Module/Build Modified Files: Authoring.pod Log Message: Add documentation for depends_on() method and clarify usage for dispatch(). Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Authoring.pod 3 Nov 2005 01:08:31 -0000 1.17 +++ Authoring.pod 3 Nov 2005 01:15:16 -0000 1.18 @@ -924,6 +924,18 @@ If you need to know the name of the original action invoked by the user, see L<invoked_action()> below. +=item depends_on(@actions) + +Invokes the named action or list of actions in sequence. Using this +method is preferred to calling the action explicitly because it +performs some internal record-keeping, and it ensures that the same +action is not invoked multiple times. + +This method is intended to be used by Module::Build subclasses when +defining custom actions that depend on other sub-actions. If you need +to invoke an action outside of the build process, see L<dispatch> +below. + =item dir_contains($first_dir, $second_dir) Returns true if the first directory logically contains the second @@ -933,13 +945,25 @@ =item dispatch($action, %args) -This method is also called from the auto-generated C<Build> script. -It parses the command line arguments into an action and an argument -list, then calls the appropriate routine to handle the action. -Currently (though this may change), an action C<foo> will invoke the -C<ACTION_foo> method. All arguments (including everything mentioned -in L<Module::Build/"ACTIONS"> ) are contained in the -C<< $self->{args} >> hash reference. +Invokes the build action C<$action>. Optionally, a list of options +and their values can be passed in. This is equivalent to invoking an +action at the command line, passing in a list of options. + +Custom options that have not been registered must be passed in as a +hash reference in a key named "args": + + $mb->dispatch('foo', verbose => 1, args => { my_option => 'value' }); + +This method is intended to be used to programmatically invoke build +actions. I.e. It's primarily to be used by applications controlling +Module::Build based builds rather than by subclasses. If you need to +invoke an action from within a F<Build.PL> script or a subclass, see +L<depends_on> above. + +Unlike C<< depends_on() >>, this method resets the list of previously +invoked actions, so actions in a previous C<< dispatch() >> call will +be invoked again in subsequent calls. However, within a single call +actions are still run only a single time. =item dist_dir() |
From: Randy W. S. <si...@us...> - 2005-11-03 01:08:39
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2806/lib/Module Modified Files: Build.pm Log Message: Alter documentation to reflect support for PREFIX-style install paths. Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.192 retrieving revision 1.193 diff -u -d -r1.192 -r1.193 --- Build.pm 1 Nov 2005 09:58:37 -0000 1.192 +++ Build.pm 3 Nov 2005 01:08:31 -0000 1.193 @@ -343,7 +343,7 @@ =item install This action will use C<ExtUtils::Install> to install the files from -C<blib/> into the system. See L<How Installation Paths are Determined> +C<blib/> into the system. See L<INSTALL PATHS> for details about how Module::Build determines where to install things, and how to influence this process. @@ -518,10 +518,13 @@ =back -=head2 General Command Line Options +=head1 OPTIONS + +=head2 Command Line Options The following options can be used during any invocation of Build.PL or -the Build script, during any action. +the Build script, during any action. For information on other options +specific to an action, see the documentation for the respective action. NOTE: There is some preliminary support for options to use the more familiar long option style. Most options can be preceded with the @@ -563,7 +566,7 @@ =back -=head2 Default Command Line Options (F<.modulebuildrc>) +=head2 Default Options File (F<.modulebuildrc>) When Module::Build starts up, it will look for a file, F<$ENV{HOME}/.modulebuildrc>. If the file exists, the options @@ -595,7 +598,7 @@ absolute path of the file containing your options. -=head2 How Installation Paths are Determined +=head1 INSTALL PATHS When you invoke Module::Build's C<build> action, it needs to figure out where to install things. The nutshell version of how this works @@ -740,11 +743,10 @@ libhtml => /home/ken/html Note that this is I<different> from how MakeMaker's C<PREFIX> -parameter works. Module::Build doesn't support MakeMaker's C<PREFIX> -option. See L</"Why PREFIX is not supported"> for more details. -C<install_base> just gives you a default layout under the directory -you specify, which may have little to do with the C<installdirs=site> -layout. +parameter works. See L</"Why PREFIX is not recommended"> for more +details. C<install_base> just gives you a default layout under the +directory you specify, which may have little to do with the +C<installdirs=site> layout. The exact layout under the directory you specify may vary by system - we try to do the "sensible" thing on each platform. @@ -769,41 +771,7 @@ =back -=head1 Alternatives to PREFIX - -Module::Build offers L</install_base> as a simple, predictable, and -user-configurable alternative to ExtUtils::MakeMaker's C<PREFIX>. -What's more, MakeMaker will soon accept C<INSTALL_BASE> -- we strongly -urge you to make the switch. - -Here's a quick comparison of the two when installing modules to your -home directory on a unix box: - -MakeMaker [*]: - - % perl Makefile.PL PREFIX=/home/spurkis - PERL5LIB=/home/spurkis/lib/perl5/5.8.5:/home/spurkis/lib/perl5/site_perl/5.8.5 - PATH=/home/spurkis/bin - MANPATH=/home/spurkis/man - -Module::Build: - - % perl Build.PL install_base=/home/spurkis - PERL5LIB=/home/spurkis/lib/perl5 - PATH=/home/spurkis/bin - MANPATH=/home/spurkis/man - -[*] Note that MakeMaker's behaviour cannot be guaranteed in even this -common scenario, and differs among different versions of MakeMaker. - -In short, using C<install_base> is similar to the following MakeMaker usage: - - perl Makefile.PL PREFIX=/home/spurkis LIB=/home/spurkis/lib/perl5 - -See L</How Installation Paths are Determined> for details on other -installation options available and how to configure them. - -=head2 Why PREFIX is not supported +=head2 About PREFIX Support First, it is necessary to understand the original idea behind C<PREFIX>. If, for example, the default installation locations for @@ -817,8 +785,10 @@ However, the real world is more complicated than that. The C<PREFIX> idea is fundamentally broken when your machine doesn't jibe with -C<PREFIX>'s worldview. A design decision was made not to support it -in Module::Build, here's a summary of the reasons why: +C<PREFIX>'s worldview. + + +=head3 Why PREFIX is not recommended =over 4 @@ -867,11 +837,41 @@ =back -=head2 PREFIX will be supported -The current maintainer of MakeMaker has offered to implement C<PREFIX> -pass-through support in Module::Build B<for backwards compatibility -only>. You are still strongly recommended to use C<install_base>. +=head3 Alternatives to PREFIX + +Module::Build offers L</install_base> as a simple, predictable, and +user-configurable alternative to ExtUtils::MakeMaker's C<PREFIX>. +What's more, MakeMaker will soon accept C<INSTALL_BASE> -- we strongly +urge you to make the switch. + +Here's a quick comparison of the two when installing modules to your +home directory on a unix box: + +MakeMaker [*]: + + % perl Makefile.PL PREFIX=/home/spurkis + PERL5LIB=/home/spurkis/lib/perl5/5.8.5:/home/spurkis/lib/perl5/site_perl/5.8.5 + PATH=/home/spurkis/bin + MANPATH=/home/spurkis/man + +Module::Build: + + % perl Build.PL install_base=/home/spurkis + PERL5LIB=/home/spurkis/lib/perl5 + PATH=/home/spurkis/bin + MANPATH=/home/spurkis/man + +[*] Note that MakeMaker's behaviour cannot be guaranteed in even this +common scenario, and differs among different versions of MakeMaker. + +In short, using C<install_base> is similar to the following MakeMaker usage: + + perl Makefile.PL PREFIX=/home/spurkis LIB=/home/spurkis/lib/perl5 + +See L</INSTALL PATHS> for details on other +installation options available and how to configure them. + =head1 MOTIVATIONS @@ -950,9 +950,9 @@ NFS, and it's just generally flimsy. It would be better to use an MD5 signature or the like, if available. See C<cons> for an example. -- append to perllocal.pod -- write .packlist in appropriate location (needed for un-install) -- add a 'plugin' functionality + - append to perllocal.pod + - write .packlist in appropriate location (needed for un-install) + - add a 'plugin' functionality =head1 AUTHOR |