module-build-checkins Mailing List for Module::Build (Page 37)
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: Ken W. <kwi...@us...> - 2004-12-28 05:14:01
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25334/lib/Module/Build Modified Files: Compat.pm Log Message: Do tilde-expansion on args to Makefile.PL Index: Compat.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Compat.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Compat.pm 30 Jul 2004 15:20:11 -0000 1.57 --- Compat.pm 28 Dec 2004 05:13:50 -0000 1.58 *************** *** 135,138 **** --- 135,142 ---- my ($key, $val) = ($arg =~ /^(\w+)=(.+)/ ? ($1, $2) : die "Malformed argument '$arg'"); + + # Do tilde-expansion like MakeMaker does, more or less + $val =~ s{^~(\w*)} { (getpwnam($1 || (getpwuid $>)[0]))[7] || "~$1" }e; + if (exists $makefile_to_build{$key}) { my $trans = $makefile_to_build{$key}; |
From: Ken W. <kwi...@us...> - 2004-12-28 05:13:59
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25334/t Modified Files: compat.t Log Message: Do tilde-expansion on args to Makefile.PL Index: compat.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/compat.t,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** compat.t 28 Nov 2004 02:30:13 -0000 1.18 --- compat.t 28 Dec 2004 05:13:50 -0000 1.19 *************** *** 21,25 **** my @makefile_types = qw(small passthrough traditional); my $tests_per_type = 10; ! plan tests => 30 + @makefile_types*$tests_per_type; ok(1); # Loaded --- 21,25 ---- my @makefile_types = qw(small passthrough traditional); my $tests_per_type = 10; ! plan tests => 32 + @makefile_types*$tests_per_type; ok(1); # Loaded *************** *** 145,148 **** --- 145,160 ---- } + { + # Make sure tilde-expansion works + Module::Build::Compat->create_makefile_pl('passthrough', $build); + + $build->run_perl_script('Makefile.PL', [], ['INSTALL_BASE=~/foo']); + my $b2 = Module::Build->current; + ok $b2->install_base; + ok $b2->install_base !~ /^~/, 1, "Tildes should be expanded"; + + $build->do_system(@make, 'realclean'); + 1 while unlink 'Makefile.PL'; + } ######################################################### |
From: Ken W. <kwi...@us...> - 2004-12-27 04:56:27
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24375 Modified Files: Build.PL Log Message: Config.pm isn't on CPAN, don't list as a prereq Index: Build.PL =================================================================== RCS file: /cvsroot/module-build/Module-Build/Build.PL,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Build.PL 18 Dec 2004 20:57:04 -0000 1.51 --- Build.PL 27 Dec 2004 04:56:18 -0000 1.52 *************** *** 21,25 **** requires => { 'perl' => '5.005_03', - 'Config' => 0, 'Data::Dumper' => 0, 'File::Basename' => 0, --- 21,24 ---- |
From: Ken W. <kwi...@us...> - 2004-12-27 04:40:08
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22426 Modified Files: MANIFEST Log Message: Index: MANIFEST =================================================================== RCS file: /cvsroot/module-build/Module-Build/MANIFEST,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** MANIFEST 7 Dec 2004 03:03:00 -0000 1.37 --- MANIFEST 27 Dec 2004 04:39:56 -0000 1.38 *************** *** 43,46 **** --- 43,47 ---- t/manifypods.t t/notes.t + t/parents.t t/pod_parser.t t/runthrough.t |
From: Ken W. <kwi...@us...> - 2004-12-27 04:30:10
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21258/lib/Module/Build Modified Files: Base.pm Log Message: Let a couple HTML-building params be overridable Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.366 retrieving revision 1.367 diff -C2 -d -r1.366 -r1.367 *** Base.pm 26 Dec 2004 05:10:37 -0000 1.366 --- Base.pm 27 Dec 2004 04:30:01 -0000 1.367 *************** *** 529,532 **** --- 529,534 ---- __PACKAGE__->add_property(recurse_into => []); __PACKAGE__->add_property(build_class => 'Module::Build'); + __PACKAGE__->add_property(html_css => ($^O =~ /Win32/) ? 'Active.css' : ''); + __PACKAGE__->add_property(html_backlink => '__top'); __PACKAGE__->add_property($_) for qw( base_dir *************** *** 1878,1892 **** } foreach my $pod (keys %$pods){ $self->_htmlify_pod( path => $pod, rel_path => $pods->{$pod}, ! htmldir => $html, ! backlink => '__top', ! css => ($^O =~ /Win32/) ? 'Active.css' : '', ); } } sub _htmlify_pod { my ($self, %args) = @_; --- 1880,1900 ---- } + my %opts = ( + css => $self->html_css, + backlink => $self->html_backlink, + htmldir => $html, + ); + foreach my $pod (keys %$pods){ $self->_htmlify_pod( path => $pod, rel_path => $pods->{$pod}, ! %opts, ); } } + # The distinction here between htmlify_pods() and _htmlify_pod() is a + # little silly. sub _htmlify_pod { my ($self, %args) = @_; |
From: Ken W. <kwi...@us...> - 2004-12-27 04:30:10
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21258 Modified Files: Changes Log Message: Let a couple HTML-building params be overridable Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.322 retrieving revision 1.323 diff -C2 -d -r1.322 -r1.323 *** Changes 26 Dec 2004 05:10:37 -0000 1.322 --- Changes 27 Dec 2004 04:30:01 -0000 1.323 *************** *** 60,63 **** --- 60,67 ---- - Eliminated an undefined-variable warning when testing under perl 5.005 + - When building HTML documentation, 'html_backlink' and 'html_css' + properties are now first-class properties, so they can be set from + the command line. [Suggested by Sagar R. Shah] + - Have script_files default to everything in bin. I believe this is the least surprising behavior. [Suggested by Michael Schwern] |
From: Ken W. <kwi...@us...> - 2004-12-26 05:11:21
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9299 Modified Files: Changes Log Message: Some changes to install_path and install_base Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.321 retrieving revision 1.322 diff -C2 -d -r1.321 -r1.322 *** Changes 18 Dec 2004 18:14:47 -0000 1.321 --- Changes 26 Dec 2004 05:10:37 -0000 1.322 *************** *** 23,26 **** --- 23,38 ---- lines. [Ron Savage] + - A user-specified 'install_path' setting will now take precedence + over an 'install_base' setting. This allows the user to use + 'install_base' to set the base for all elements in one go, and then + use 'install_path' to override specific paths or add paths for + additional kinds of targets. + + * When using the 'install_base' option to choose a directory for + installing everything, perl modules now go into lib/perl5/ instead + of just lib/. It seems this is more consistent with people's + expectations, and the way I had it before was a bit peculiar to the + way I like things in my own home directory. [Michael Schwern] + - Added docs for run_perl_script(). |
From: Ken W. <kwi...@us...> - 2004-12-26 05:11:07
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9299/t Modified Files: install.t Log Message: Some changes to install_path and install_base Index: install.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/install.t,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** install.t 4 Oct 2004 22:13:48 -0000 1.12 --- install.t 26 Dec 2004 05:10:52 -0000 1.13 *************** *** 2,6 **** use Test; ! BEGIN { plan tests => 29 } use Module::Build; use File::Spec; --- 2,6 ---- use Test; ! BEGIN { plan tests => 31 } use Module::Build; use File::Spec; *************** *** 64,68 **** eval {$build->dispatch('install', install_base => $libdir, destdir => $destdir)}; ok $@, ''; ! my $install_to = File::Spec->catfile($destdir, $libdir, 'lib', 'Sample.pm'); print "Should have installed module as $install_to\n"; ok -e $install_to; --- 64,68 ---- eval {$build->dispatch('install', install_base => $libdir, destdir => $destdir)}; ok $@, ''; ! my $install_to = File::Spec->catfile($destdir, $libdir, 'lib', 'perl5', 'Sample.pm'); print "Should have installed module as $install_to\n"; ok -e $install_to; *************** *** 125,132 **** ok $@, ''; ! my $relpath = $build->install_base_relative('lib'); ! $install_to = File::Spec->catfile($destdir, $basedir, $relpath, 'Sample.pm'); ! print "# Should have installed module as $install_to\n"; ! ok -e $install_to; eval {$build->dispatch('realclean')}; --- 125,130 ---- ok $@, ''; ! $install_to = File::Spec->catfile($destdir, $libdir, 'Sample.pm'); ! ok -e $install_to, 1, "Look for file at $install_to"; eval {$build->dispatch('realclean')}; *************** *** 135,138 **** --- 133,145 ---- { + # Make sure 'install_path' overrides 'install_base' + my $build = Module::Build->new( module_name => 'Sample', + install_base => File::Spec->catdir('', 'foo'), + install_path => {lib => File::Spec->catdir('', 'bar')}); + ok $build; + ok $build->install_destination('lib'), File::Spec->catdir('', 'bar'); + } + + { # _find_file_by_type() isn't a public method, but this is currently # the only easy way to test that it works properly. |
From: Ken W. <kwi...@us...> - 2004-12-26 05:11:06
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9299/lib/Module/Build Modified Files: Base.pm Log Message: Some changes to install_path and install_base Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.365 retrieving revision 1.366 diff -C2 -d -r1.365 -r1.366 *** Base.pm 18 Dec 2004 21:17:12 -0000 1.365 --- Base.pm 26 Dec 2004 05:10:37 -0000 1.366 *************** *** 2485,2490 **** my ($self, $type) = @_; my %map = ( ! lib => ['lib'], ! arch => ['lib', $self->{config}{archname}], bin => ['bin'], script => ['bin'], --- 2485,2490 ---- my ($self, $type) = @_; my %map = ( ! lib => ['lib', 'perl5'], ! arch => ['lib', 'perl5', $self->{config}{archname}], bin => ['bin'], script => ['bin'], *************** *** 2500,2507 **** my $p = $self->{properties}; - if ($p->{install_base}) { - return File::Spec->catdir($p->{install_base}, $self->install_base_relative($type)); - } return $p->{install_path}{$type} if exists $p->{install_path}{$type}; return $p->{install_sets}{ $p->{installdirs} }{$type}; } --- 2500,2505 ---- my $p = $self->{properties}; return $p->{install_path}{$type} if exists $p->{install_path}{$type}; + return File::Spec->catdir($p->{install_base}, $self->install_base_relative($type)) if $p->{install_base}; return $p->{install_sets}{ $p->{installdirs} }{$type}; } |
From: Ken W. <kwi...@us...> - 2004-12-18 21:17:22
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32438/lib/Module/Build Modified Files: Base.pm Log Message: Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.364 retrieving revision 1.365 diff -C2 -d -r1.364 -r1.365 *** Base.pm 18 Dec 2004 21:15:42 -0000 1.364 --- Base.pm 18 Dec 2004 21:17:12 -0000 1.365 *************** *** 2725,2728 **** --- 2725,2730 ---- sub run_perl_command { + # XXX Maybe we should accept @args instead of $args? Must resolve + # this before documenting. my ($self, $args) = @_; $args = [ $self->split_like_shell($args) ] unless ref($args); |
From: Ken W. <kwi...@us...> - 2004-12-18 21:16:28
|
Update of /cvsroot/module-build/Module-Build/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31864/inc Modified Files: ModuleBuildBuilder.pm Log Message: Use the new run_perl_command() because it's nicer here Index: ModuleBuildBuilder.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/inc/ModuleBuildBuilder.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ModuleBuildBuilder.pm 18 Dec 2004 20:57:04 -0000 1.2 --- ModuleBuildBuilder.pm 18 Dec 2004 21:16:07 -0000 1.3 *************** *** 20,42 **** # Replace "<autogenerated_accessors>" with some POD lists my @need_doc = sort grep !$subs{$_}, $self->valid_properties; ! $self->run_perl_script($authoring_pod, ! ['-pi', ! '-e', ! qq[s{<autogenerated_accessors>}{ join "\\n\\n", map "=item \$_()", qw(@need_doc) }e] ], ! []); # Replace "<action_list>" with a list of actions my $action_text = $self->_action_listing(scalar $self->known_actions); ! $self->run_perl_script($build_pm, ! ['-pi', '-e', qq[s{<action_list>}{$action_text}]], ! []); # Finally, sneakily rewrite the Build.PL to use a vanilla # Module::Build object instead of a ModuleBuildBuilder. ! $self->run_perl_script($build_pl, ! ['-pi', '-e', qq[BEGIN{\$/=undef} s{<remove_me>.*</remove_me>}{}gs]], ! []); ! $self->run_perl_script($build_pl, ! ['-pi', '-e', qq[s{ModuleBuildBuilder}{Module::Build}gs]], ! []); } --- 20,35 ---- # Replace "<autogenerated_accessors>" with some POD lists my @need_doc = sort grep !$subs{$_}, $self->valid_properties; ! $self->run_perl_command(['-pi', ! '-e', ! qq[s{<autogenerated_accessors>}{ join "\\n\\n", map "=item \$_()", qw(@need_doc) }e], ! $authoring_pod]); # Replace "<action_list>" with a list of actions my $action_text = $self->_action_listing(scalar $self->known_actions); ! $self->run_perl_command(['-pi', '-e', qq[s{<action_list>}{$action_text}], $build_pm]); # Finally, sneakily rewrite the Build.PL to use a vanilla # Module::Build object instead of a ModuleBuildBuilder. ! $self->run_perl_command(['-pi', '-e', qq[BEGIN{\$/=undef} s{<remove_me>.*</remove_me>}{}gs], $build_pl]); ! $self->run_perl_command(['-pi', '-e', qq[s{ModuleBuildBuilder}{Module::Build}gs], $build_pl]); } |
From: Ken W. <kwi...@us...> - 2004-12-18 21:15:54
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31752/lib/Module/Build Modified Files: Base.pm Log Message: Create a run_perl_command() method and make run_perl_script() use it Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.363 retrieving revision 1.364 diff -C2 -d -r1.363 -r1.364 *** Base.pm 18 Dec 2004 20:57:05 -0000 1.363 --- Base.pm 18 Dec 2004 21:15:42 -0000 1.364 *************** *** 2721,2724 **** --- 2721,2730 ---- $_ = [ $self->split_like_shell($_) ] unless ref(); } + return $self->run_perl_command([@$preargs, $script, @$postargs]); + } + + sub run_perl_command { + my ($self, $args) = @_; + $args = [ $self->split_like_shell($args) ] unless ref($args); my $perl = ref($self) ? $self->perl : $self->find_perl_interpreter; *************** *** 2727,2731 **** local $ENV{PERL5LIB} = join $c->{path_sep}, $self->_added_to_INC; ! return $self->do_system($perl, @$preargs, $script, @$postargs); } --- 2733,2737 ---- local $ENV{PERL5LIB} = join $c->{path_sep}, $self->_added_to_INC; ! return $self->do_system($perl, @$args); } |
From: Ken W. <kwi...@us...> - 2004-12-18 20:57:16
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23059/lib/Module/Build Modified Files: Authoring.pod Base.pm Log Message: Some changes to the way Module::Build itself is bundled up for distribution: 1) it now autogenerates the listing of actions near the top of the M::B documentation. 2) it now autogenerates a listing of get/set accessors that wouldn't otherwise be documented at all. 3) it now erases any trace of the ModuleBuildBuilder module that does this stuff, since it's not necessary for people downloading from CPAN to know anything about it. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.362 retrieving revision 1.363 diff -C2 -d -r1.362 -r1.363 *** Base.pm 15 Dec 2004 21:32:46 -0000 1.362 --- Base.pm 18 Dec 2004 20:57:05 -0000 1.363 *************** *** 1414,1417 **** --- 1414,1426 ---- Actions defined: EOF + + print $self->_action_listing($actions); + + print "\nRun `Build help <action>` for details on an individual action.\n"; + print "See `perldoc Module::Build` for complete documentation.\n"; + } + + sub _action_listing { + my ($self, $actions) = @_; # Flow down columns, not across rows *************** *** 1419,1428 **** @actions = map $actions[($_ + ($_ % 2) * @actions) / 2], 0..$#actions; while (my ($one, $two) = splice @actions, 0, 2) { ! printf(" %-12s %-12s\n", $one, $two||''); } ! ! print "\nRun `Build help <action>` for details on an individual action.\n"; ! print "See `perldoc Module::Build` for complete documentation.\n"; } --- 1428,1436 ---- @actions = map $actions[($_ + ($_ % 2) * @actions) / 2], 0..$#actions; + my $out = ''; while (my ($one, $two) = splice @actions, 0, 2) { ! $out .= sprintf(" %-12s %-12s\n", $one, $two||''); } ! return $out; } Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Authoring.pod 7 Dec 2004 03:25:53 -0000 1.2 --- Authoring.pod 18 Dec 2004 20:57:05 -0000 1.3 *************** *** 1044,1047 **** --- 1044,1058 ---- =back + =head2 Autogenerated Accessors + + In addition to the aforementioned methods, there are also some get/set + accessor methods for the following properties: + + =over 4 + + <autogenerated_accessors> + + =back + =head1 SAVING CONFIGURATION INFORMATION |
From: Ken W. <kwi...@us...> - 2004-12-18 20:57:15
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23059/lib/Module Modified Files: Build.pm Log Message: Some changes to the way Module::Build itself is bundled up for distribution: 1) it now autogenerates the listing of actions near the top of the M::B documentation. 2) it now autogenerates a listing of get/set accessors that wouldn't otherwise be documented at all. 3) it now erases any trace of the ModuleBuildBuilder module that does this stuff, since it's not necessary for people downloading from CPAN to know anything about it. Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.172 retrieving revision 1.173 diff -C2 -d -r1.172 -r1.173 *** Build.pm 18 Dec 2004 18:14:48 -0000 1.172 --- Build.pm 18 Dec 2004 20:57:04 -0000 1.173 *************** *** 147,163 **** action), 'test', and 'install'. Other actions defined so far include: ! build fakeinstall ! config_data help ! clean html ! code install ! diff manifest ! dist ppd ! distcheck ppmdist ! distclean realclean ! distdir skipcheck ! distmeta test ! distsign testcover ! disttest testdb ! docs versioninstall You can run the 'help' action for a complete list of actions. --- 147,151 ---- action), 'test', and 'install'. Other actions defined so far include: ! <action_list> You can run the 'help' action for a complete list of actions. |
From: Ken W. <kwi...@us...> - 2004-12-18 20:57:15
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23059 Modified Files: Build.PL Log Message: Some changes to the way Module::Build itself is bundled up for distribution: 1) it now autogenerates the listing of actions near the top of the M::B documentation. 2) it now autogenerates a listing of get/set accessors that wouldn't otherwise be documented at all. 3) it now erases any trace of the ModuleBuildBuilder module that does this stuff, since it's not necessary for people downloading from CPAN to know anything about it. Index: Build.PL =================================================================== RCS file: /cvsroot/module-build/Module-Build/Build.PL,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Build.PL 28 Nov 2004 02:36:03 -0000 1.50 --- Build.PL 18 Dec 2004 20:57:04 -0000 1.51 *************** *** 5,15 **** use File::Spec; use lib File::Spec->catdir('lib'); - use lib File::Spec->catdir('inc'); # We use Module::Build to test & install itself. use Module::Build; # A custom builder that does some special stuff during the 'dist' phase use ModuleBuildBuilder; my $build = new ModuleBuildBuilder --- 5,17 ---- use File::Spec; use lib File::Spec->catdir('lib'); # We use Module::Build to test & install itself. use Module::Build; + # <remove_me> This code is only present for M::B developers, not on CPAN + use lib File::Spec->catdir('inc'); # A custom builder that does some special stuff during the 'dist' phase use ModuleBuildBuilder; + # </remove_me> my $build = new ModuleBuildBuilder |
From: Ken W. <kwi...@us...> - 2004-12-18 20:57:14
|
Update of /cvsroot/module-build/Module-Build/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23059/inc Modified Files: ModuleBuildBuilder.pm Log Message: Some changes to the way Module::Build itself is bundled up for distribution: 1) it now autogenerates the listing of actions near the top of the M::B documentation. 2) it now autogenerates a listing of get/set accessors that wouldn't otherwise be documented at all. 3) it now erases any trace of the ModuleBuildBuilder module that does this stuff, since it's not necessary for people downloading from CPAN to know anything about it. Index: ModuleBuildBuilder.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/inc/ModuleBuildBuilder.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ModuleBuildBuilder.pm 4 Nov 2004 01:42:38 -0000 1.1 --- ModuleBuildBuilder.pm 18 Dec 2004 20:57:04 -0000 1.2 *************** *** 10,23 **** $self->SUPER::ACTION_distdir(@_); ! my $base = $INC{'Module/Build/Base.pm'}; ! open my($fh), $base or die "Couldn't read $base: $!"; my %subs = map {$_,1} map +(/^\s*sub (\w+)/)[0], <$fh>; my @need_doc = sort grep !$subs{$_}, $self->valid_properties; ! $self->run_perl_script(File::Spec->catfile($self->dist_dir, qw(lib Module Build.pm)), ['-pi', '-e', qq[s{<autogenerated_accessors>}{ join "\\n\\n", map "=item \$_()", qw(@need_doc) }e] ], ! [], ! ); } --- 10,42 ---- $self->SUPER::ACTION_distdir(@_); ! my $build_pl = File::Spec->catfile($self->dist_dir, qw(Build.PL)); ! my $build_pm = File::Spec->catfile($self->dist_dir, qw(lib Module Build.pm)); ! my $base_pm = File::Spec->catfile($self->dist_dir, qw(lib Module Build Base.pm)); ! my $authoring_pod = File::Spec->catfile($self->dist_dir, qw(lib Module Build Authoring.pod)); ! ! open my($fh), $base_pm or die "Couldn't read $base_pm: $!"; my %subs = map {$_,1} map +(/^\s*sub (\w+)/)[0], <$fh>; + # Replace "<autogenerated_accessors>" with some POD lists my @need_doc = sort grep !$subs{$_}, $self->valid_properties; ! $self->run_perl_script($authoring_pod, ['-pi', '-e', qq[s{<autogenerated_accessors>}{ join "\\n\\n", map "=item \$_()", qw(@need_doc) }e] ], ! []); ! ! # Replace "<action_list>" with a list of actions ! my $action_text = $self->_action_listing(scalar $self->known_actions); ! $self->run_perl_script($build_pm, ! ['-pi', '-e', qq[s{<action_list>}{$action_text}]], ! []); ! ! # Finally, sneakily rewrite the Build.PL to use a vanilla ! # Module::Build object instead of a ModuleBuildBuilder. ! $self->run_perl_script($build_pl, ! ['-pi', '-e', qq[BEGIN{\$/=undef} s{<remove_me>.*</remove_me>}{}gs]], ! []); ! $self->run_perl_script($build_pl, ! ['-pi', '-e', qq[s{ModuleBuildBuilder}{Module::Build}gs]], ! []); } |
From: Ken W. <kwi...@us...> - 2004-12-18 20:15:15
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15209/lib/Module Modified Files: Tag: release-0_26_branch Build.pm Log Message: Version bump Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.164.2.8 retrieving revision 1.164.2.9 diff -C2 -d -r1.164.2.8 -r1.164.2.9 *** Build.pm 8 Dec 2004 04:32:38 -0000 1.164.2.8 --- Build.pm 18 Dec 2004 20:15:03 -0000 1.164.2.9 *************** *** 16,20 **** use vars qw($VERSION @ISA); @ISA = qw(Module::Build::Base); ! $VERSION = '0.2606'; $VERSION = eval $VERSION; --- 16,20 ---- use vars qw($VERSION @ISA); @ISA = qw(Module::Build::Base); ! $VERSION = '0.2607'; $VERSION = eval $VERSION; |
From: Ken W. <kwi...@us...> - 2004-12-18 20:15:13
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15209 Modified Files: Tag: release-0_26_branch Changes Log Message: Version bump Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.299.2.22 retrieving revision 1.299.2.23 diff -C2 -d -r1.299.2.22 -r1.299.2.23 *** Changes 13 Dec 2004 04:39:34 -0000 1.299.2.22 --- Changes 18 Dec 2004 20:15:03 -0000 1.299.2.23 *************** *** 1,5 **** Revision history for Perl extension Module::Build. ! 0.2607 - Instead of freezing @INC in the 'Build' script to the value it had --- 1,5 ---- Revision history for Perl extension Module::Build. ! 0.2607 (Bug fix release in 0.26 series) Sat Dec 18 14:14:09 CST 2004 - Instead of freezing @INC in the 'Build' script to the value it had *************** *** 13,17 **** instance. [Michael Schwern] ! 0.2606 (Bug fix for 0.26) Tue Dec 7 22:33:11 CST 2004 - Fixed a linking bug on Win32, in which compiled C code object files --- 13,17 ---- instance. [Michael Schwern] ! 0.2606 (Bug fix release in 0.26 series) Tue Dec 7 22:33:11 CST 2004 - Fixed a linking bug on Win32, in which compiled C code object files *************** *** 22,26 **** passed made us die. [Spotted by Jos Boumans] ! 0.2605 (Bug fix for 0.26) Tue Nov 30 07:16:13 CST 2004 - Fixed a bug in which zero-length arguments for hash-valued --- 22,26 ---- passed made us die. [Spotted by Jos Boumans] ! 0.2605 (Bug fix release in 0.26 series) Tue Nov 30 07:16:13 CST 2004 - Fixed a bug in which zero-length arguments for hash-valued *************** *** 32,36 **** - Fixed a syntax error in one of the tests under perl 5.005. ! 0.2604 (Bug fix for 0.26) Wed Nov 17 14:32:42 CST 2004 - Fixed a split_like_shell() bug introduced in 0.2603 for Windows, in --- 32,36 ---- - Fixed a syntax error in one of the tests under perl 5.005. ! 0.2604 (Bug fix release in 0.26 series) Wed Nov 17 14:32:42 CST 2004 - Fixed a split_like_shell() bug introduced in 0.2603 for Windows, in *************** *** 46,50 **** 'recursive_test_files' is in effect. [Tom Insam] ! 0.2603 (Bug fix for 0.26) Mon Nov 15 10:28:00 CST 2004 - Added documentation for the new_from_context() method. --- 46,50 ---- 'recursive_test_files' is in effect. [Tom Insam] ! 0.2603 (Bug fix release in 0.26 series) Mon Nov 15 10:28:00 CST 2004 - Added documentation for the new_from_context() method. *************** *** 53,57 **** platform so it works like the command.com shell. [Randy Sims] ! 0.2602 (Bug fix for 0.26) Thu Nov 4 11:19:29 CST 2004 - The two bug fixes in 0.2601 gnashed against each other incorrectly, --- 53,57 ---- platform so it works like the command.com shell. [Randy Sims] ! 0.2602 (Bug fix release in 0.26 series) Thu Nov 4 11:19:29 CST 2004 - The two bug fixes in 0.2601 gnashed against each other incorrectly, *************** *** 63,67 **** available. [Blair Zajac] ! 0.2601 (Bug fix for 0.26) Wed Nov 3 20:09:27 CST 2004 - Fixed some backslash problems with split_like_shell() on --- 63,67 ---- available. [Blair Zajac] ! 0.2601 (Bug fix release in 0.26 series) Wed Nov 3 20:09:27 CST 2004 - Fixed some backslash problems with split_like_shell() on |
From: Ken W. <kwi...@us...> - 2004-12-18 18:15:04
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22012/lib/Module Modified Files: Build.pm Log Message: Add section on why PREFIX is not supported Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.171 retrieving revision 1.172 diff -C2 -d -r1.171 -r1.172 *** Build.pm 6 Dec 2004 13:38:08 -0000 1.171 --- Build.pm 18 Dec 2004 18:14:48 -0000 1.172 *************** *** 625,634 **** Note that this is I<different> from how MakeMaker's C<PREFIX> ! parameter works. C<PREFIX> tries to create a mini-replica of a ! C<site>-style installation under the directory you specify, which is ! not always possible (and the results are not always pretty in this ! case). 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 - --- 625,633 ---- 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. The exact layout under the directory you specify may vary by system - *************** *** 655,658 **** --- 654,753 ---- =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 + + First, it is necessary to understand the original idea behind + C<PREFIX>. If, for example, the default installation locations for + your machine are F</usr/local/lib/perl5/5.8.5> for modules, + F</usr/local/bin> for executables, F</usr/local/man/man1> and + F</usr/local/man/man3> for manual pages, etc., then they all share the + same "prefix" F</usr/local>. MakeMaker's C<PREFIX> mechanism was + intended as a way to change an existing prefix that happened to occur + in all those paths - essentially a C<< s{/usr/local}{/foo/bar} >> for + each path. + + 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: + + =over 4 + + =item * + + Many systems have Perl configs that make little sense with PREFIX. + For example, OS X, where core modules go in + F</System/Library/Perl/...>, user-installed modules go in + F</Library/Perl/...>, and man pages go in F</usr/share/man/...>. + Install L<Foo::Bar> on OS X with C<PREFIX=/home/spurkis> and you get + things like F</home/spurkis/Library/Perl/5.8.1/Foo/Bar.pm> and + F</home/spurkis/usr/share/man/man3/Foo::Bar.3pm>. Not too pretty. + + =item * + + The PREFIX logic is too complicated and hard to predict for the user. + It's hard to document what exactly is going to happen. You can't give + a user simple instructions like "run perl Makefile.PL PREFIX=~ and + then set PERL5LIB=~/lib/perl5". + + =item * + + The results from PREFIX will change if your configuration of Perl + changes (for example, if you upgrade Perl). This means your modules + will end up in different places. + + =item * + + The results from PREFIX can change with different releases of + MakeMaker. The logic of PREFIX is subtle and it has been altered in + the past (mostly to limit damage in the many "edge cases" when its + behavior was undesirable). + + =item * + + PREFIX imposes decisions made by the person who configured Perl onto + the person installing a module. The person who configured Perl could + have been you or it could have been some guy at Redhat. + + =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 compatability + only>. You are still strongly recommended to use C<install_base>. =head1 MOTIVATIONS |
From: Ken W. <kwi...@us...> - 2004-12-18 18:15:01
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22012 Modified Files: Changes Log Message: Add section on why PREFIX is not supported Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.320 retrieving revision 1.321 diff -C2 -d -r1.320 -r1.321 *** Changes 6 Dec 2004 13:38:09 -0000 1.320 --- Changes 18 Dec 2004 18:14:47 -0000 1.321 *************** *** 25,28 **** --- 25,31 ---- - Added docs for run_perl_script(). + - Added some stuff to the docs about why PREFIX is unsupported, and + what to use instead. [Steve Purkis] + - The simple get/set accessor methods for all the 'parameters' like verbose(), license(), etc. now have auto-generated documentation in |
From: Ken W. <kwi...@us...> - 2004-12-15 21:32:59
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6066/t Modified Files: extend.t Added Files: parents.t Log Message: David's patch for dynamic addition of properties --- NEW FILE: parents.t --- use strict; use Test; BEGIN { plan tests => 27 } use Module::Build; ok(1); package Foo; sub foo; package MySub1; use base 'Module::Build'; package MySub2; use base 'MySub1'; package MySub3; use base qw(MySub2 Foo); package MyTest; use base 'Module::Build'; package MyBulk; use base qw(MySub2 MyTest); package main; ok my @parents = MySub1->mb_parents; # There will be at least one platform class in between. ok @parents >= 2; # They should all inherit from Module::Build::Base; ok ! grep { !$_->isa('Module::Build::Base') } @parents; ok $parents[0], 'Module::Build'; ok $parents[-1], 'Module::Build::Base'; ok @parents = MySub2->mb_parents; ok @parents >= 3; ok ! grep { !$_->isa('Module::Build::Base') } @parents; ok $parents[0], 'MySub1'; ok $parents[1], 'Module::Build'; ok $parents[-1], 'Module::Build::Base'; ok @parents = MySub3->mb_parents; ok @parents >= 4; ok ! grep { !$_->isa('Module::Build::Base') } @parents; ok $parents[0], 'MySub2'; ok $parents[1], 'MySub1'; ok $parents[2], 'Module::Build'; ok $parents[-1], 'Module::Build::Base'; ok @parents = MyBulk->mb_parents; ok @parents >= 5; ok ! grep { !$_->isa('Module::Build::Base') } @parents; ok $parents[0], 'MySub2'; ok $parents[1], 'MySub1'; ok $parents[2], 'Module::Build'; ok $parents[-2], 'Module::Build::Base'; ok $parents[-1], 'MyTest'; Index: extend.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/extend.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** extend.t 21 Nov 2004 15:32:33 -0000 1.7 --- extend.t 15 Dec 2004 21:32:48 -0000 1.8 *************** *** 1,6 **** use strict; use Test; ! BEGIN { plan tests => 11 } use Module::Build; ok 1; --- 1,8 ---- use strict; + # Tests various ways to extend Module::Build, e.g. by subclassing. + use Test; ! BEGIN { plan tests => 45 } use Module::Build; ok 1; *************** *** 54,55 **** --- 56,151 ---- $build->dispatch('realclean'); } + + + { + package MBSub; + use Test; + use vars qw($VERSION @ISA); + @ISA = qw(Module::Build); + $VERSION = 0.01; + + # Add a new property. + ok(__PACKAGE__->add_property('foo')); + # Add a new property with a default value. + ok(__PACKAGE__->add_property('bar', 'hey')); + # Add a hash property. + ok(__PACKAGE__->add_property('hash', {})); + + + # Catch an exception adding an existing property. + eval { __PACKAGE__->add_property('module_name')}; + ok "$@", qr/Property "module_name" already exists/; + } + + { + package MBSub2; + use Test; + use vars qw($VERSION @ISA); + @ISA = qw(Module::Build); + $VERSION = 0.01; + + # Add a new property with a different default value than MBSub has. + ok(__PACKAGE__->add_property('bar', 'yow')); + } + + + chdir($start_dir) or die "Can't chdir back to $start_dir: $!"; + chdir('t') or die "Can't chdir to t/: $!"; + { + ok my $build = MBSub->new( module_name => 'ModuleBuildOne' ); + ok $build->isa('Module::Build'); + ok $build->isa('MBSub'); + ok $build->valid_property('foo'); + # Ppbbbblllltttt! Stupid Test::ok doesn't know that a code reference + # is a true value. Duh! Turns out it executes it and checks its return + # value, instead. D'oh! -David Wheeler + ok !!$build->can('module_name'); + + # Check foo property. + ok !!$build->can('foo'); + ok ! $build->foo; + ok $build->foo(1); + ok $build->foo; + + # Check bar property. + ok !!$build->can('bar'); + ok $build->bar, 'hey'; + ok $build->bar('you'); + ok $build->bar, 'you'; + + # Check hash property. + ok $build = MBSub->new( + module_name => 'ModuleBuildOne', + hash => { foo => 'bar', bin => 'foo'} + ); + + ok !!$build->can('hash'); + ok ref $build->hash, 'HASH'; + ok $build->hash->{foo}, 'bar'; + ok $build->hash->{bin}, 'foo'; + + # Check hash property passed via the command-line. + { + local @ARGV = ( + '--hash', 'foo=bar', + '--hash', 'bin=foo', + ); + ok $build = MBSub->new( + module_name => 'ModuleBuildOne', + ); + } + + ok !!$build->can('hash'); + ok ref $build->hash, 'HASH'; + ok $build->hash->{foo}, 'bar'; + ok $build->hash->{bin}, 'foo'; + + # Make sure that a different subclass with the same named property has a + # different default. + ok $build = MBSub2->new( module_name => 'ModuleBuildOne' ); + ok $build->isa('Module::Build'); + ok $build->isa('MBSub2'); + ok $build->valid_property('bar'); + ok !!$build->can('bar'); + ok $build->bar, 'yow'; + } |
From: Ken W. <kwi...@us...> - 2004-12-15 21:32:59
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6066/lib/Module/Build Modified Files: Base.pm Log Message: David's patch for dynamic addition of properties Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.361 retrieving revision 1.362 diff -C2 -d -r1.361 -r1.362 *** Base.pm 13 Dec 2004 04:37:42 -0000 1.361 --- Base.pm 15 Dec 2004 21:32:46 -0000 1.362 *************** *** 84,107 **** config => {%Config, %$config}, properties => { - module_name => '', - build_script => 'Build', base_dir => $package->cwd, - config_dir => '_build', - blib => 'blib', - requires => {}, - recommends => {}, - build_requires => {}, - conflicts => {}, mb_version => $Module::Build::VERSION, - build_elements => [qw( PL support pm xs pod script )], - installdirs => 'site', - install_path => {}, - include_dirs => [], - recurse_into => [], - build_class => $package, %input, }, }, $package; my ($p, $c) = ($self->{properties}, $self->{config}); --- 84,94 ---- config => {%Config, %$config}, properties => { base_dir => $package->cwd, mb_version => $Module::Build::VERSION, %input, }, }, $package; + $self->_set_defaults; my ($p, $c) = ($self->{properties}, $self->{config}); *************** *** 117,121 **** $p->{libdoc_dirs} ||= [ "$p->{blib}/lib", "$p->{blib}/arch" ]; ! $p->{dist_author} = [ $p->{dist_author} ] if exists $p->{dist_author} and not ref $p->{dist_author}; # Synonyms --- 104,108 ---- $p->{libdoc_dirs} ||= [ "$p->{blib}/lib", "$p->{blib}/arch" ]; ! $p->{dist_author} = [ $p->{dist_author} ] if defined $p->{dist_author} and not ref $p->{dist_author}; # Synonyms *************** *** 436,500 **** { ! # XXX huge hack alert - will revisit this later ! my %valid_properties = map {$_ => 1} ! qw( ! module_name ! dist_name ! dist_version ! dist_version_from ! dist_author ! build_class ! dist_abstract ! requires ! recommends ! license ! pm_files ! xs_files ! pod_files ! PL_files ! scripts ! script_files ! test_files ! recursive_test_files ! perl ! config_dir ! blib ! has_config_data ! build_script ! build_elements ! install_sets ! install_path ! install_base ! installdirs ! destdir ! debugger ! verbose ! c_source ! autosplit ! create_makefile_pl ! create_readme ! pollute ! extra_compiler_flags ! include_dirs ! bindoc_dirs ! libdoc_dirs ! get_options ! recurse_into ! ); ! sub valid_property { exists $valid_properties{$_[1]} } ! sub valid_properties { keys %valid_properties } ! # Create an accessor for each property that doesn't already have one ! foreach my $property (keys %valid_properties) { ! next if __PACKAGE__->can($property); ! no strict 'refs'; ! *{$property} = sub { ! my $self = shift; ! $self->{properties}{$property} = shift if @_; ! return $self->{properties}{$property}; ! }; ! } } --- 423,593 ---- { ! my %valid_properties = ( __PACKAGE__ => {} ); ! my %additive_properties; ! sub valid_property { ! my $class = shift->_prop_class; ! exists $valid_properties{$class}->{$_[0]} ! } ! sub valid_properties { ! my $class = shift->_prop_class; ! keys %{ $valid_properties{$class} }; ! } ! sub array_properties { ! my $class = shift->_prop_class; ! return unless exists $additive_properties{$class}->{ARRAY}; ! return @{$additive_properties{$class}->{ARRAY}}; ! } ! ! sub hash_properties { ! my $class = shift->_prop_class; ! return unless exists $additive_properties{$class}->{'HASH'}; ! return @{$additive_properties{$class}->{'HASH'}}; ! } ! ! sub add_property { ! my ($class, $property, $default) = @_; ! unless (exists $valid_properties{$class}) { ! # Set it up with the properties from the parent classes, first. ! for my $parent (reverse $class->mb_parents) { ! $valid_properties{$class}->{$_} = $valid_properties{$parent}->{$_} ! for keys %{ $valid_properties{$parent} }; ! } ! } ! ! return $class unless $property; ! ! die qq{Property "$property" already exists\n} ! if $class->valid_property($property); ! if (my $type = ref $default) { ! push @{$additive_properties{$class}->{$type}}, $property; ! } ! ! $valid_properties{$class}->{$property} = $default; ! return $class if $class->can($property); ! no strict 'refs'; ! *{"$class\::$property"} = sub { ! my $self = shift; ! $self->{properties}{$property} = shift if @_; ! return $self->{properties}{$property}; ! }; ! return $class; ! } ! ! sub _prop_class { ! my $class = ref $_[0] || $_[0]; ! unless (exists $valid_properties{$class}) { ! if (my @parents = $class->mb_parents) { ! do { ! $class = shift @parents; ! } until (exists $valid_properties{$class} || !@parents); ! } ! } ! return $class; ! } ! ! sub _set_defaults { ! my $self = shift; ! my $class = $self->_prop_class; ! # Set the build class. ! $self->{build_properties}{build_class} ||= ref $self; ! for my $prop ($self->valid_properties) { ! $self->{properties}{$prop} = $valid_properties{$class}->{$prop} ! unless exists $self->{properties}{$prop}; ! } ! # Copy defaults for arrays any arrays. ! for my $prop ($self->array_properties) { ! $self->{properties}{$prop} = [@{$valid_properties{$class}->{$prop}}] ! unless exists $self->{properties}{$prop}; ! } ! # Copy defaults for arrays any hashes. ! for my $prop ($self->hash_properties) { ! $self->{properties}{$prop} = {%{$valid_properties{$class}->{$prop}}} ! unless exists $self->{properties}{$prop}; ! } ! } ! ! } ! ! # Add the default properties. ! __PACKAGE__->add_property(module_name => ''); ! __PACKAGE__->add_property(build_script => 'Build'); ! __PACKAGE__->add_property(config_dir => '_build'); ! __PACKAGE__->add_property(blib => 'blib'); ! __PACKAGE__->add_property(requires => {}); ! __PACKAGE__->add_property(recommends => {}); ! __PACKAGE__->add_property(build_requires => {}); ! __PACKAGE__->add_property(conflicts => {}); ! __PACKAGE__->add_property('mb_version'); ! __PACKAGE__->add_property(build_elements => [qw(PL support pm xs pod script)]); ! __PACKAGE__->add_property(installdirs => 'site'); ! __PACKAGE__->add_property(install_path => {}); ! __PACKAGE__->add_property(include_dirs => []); ! __PACKAGE__->add_property('config', {}); ! __PACKAGE__->add_property(recurse_into => []); ! __PACKAGE__->add_property(build_class => 'Module::Build'); ! __PACKAGE__->add_property($_) for qw( ! base_dir ! dist_name ! dist_version ! dist_version_from ! dist_author ! dist_abstract ! license ! pm_files ! xs_files ! pod_files ! PL_files ! scripts ! script_files ! test_files ! recursive_test_files ! perl ! has_config_data ! install_sets ! install_base ! destdir ! debugger ! verbose ! c_source ! autosplit ! create_makefile_pl ! create_readme ! pollute ! extra_compiler_flags ! bindoc_dirs ! libdoc_dirs ! get_options ! ); ! ! sub mb_parents { ! # Code borrowed from Class::ISA. ! my @in_stack = (shift); ! my %seen = ($in_stack[0] => 1); ! ! my ($current, @out); ! while (@in_stack) { ! next unless defined($current = shift @in_stack) ! && $current->isa('Module::Build::Base'); ! push @out, $current; ! next if $current eq 'Module::Build::Base'; ! no strict 'refs'; ! unshift @in_stack, ! map { ! my $c = $_; # copy, to avoid being destructive ! substr($c,0,2) = "main::" if substr($c,0,2) eq '::'; ! # Canonize the :: -> main::, ::foo -> main::foo thing. ! # Should I ever canonize the Foo'Bar = Foo::Bar thing? ! $seen{$c}++ ? () : $c; ! } @{"$current\::ISA"}; ! ! # I.e., if this class has any parents (at least, ones I've never seen ! # before), push them, in order, onto the stack of classes I need to ! # explore. ! } ! shift @out; ! return @out; } *************** *** 547,551 **** my $self = shift; my $p = $self->{properties}; ! return $p->{dist_name} if exists $p->{dist_name}; die "Can't determine distribution name, must supply either 'dist_name' or 'module_name' parameter" --- 640,644 ---- my $self = shift; my $p = $self->{properties}; ! return $p->{dist_name} if defined $p->{dist_name}; die "Can't determine distribution name, must supply either 'dist_name' or 'module_name' parameter" *************** *** 561,565 **** my $p = $self->{properties}; ! return $p->{dist_version} if exists $p->{dist_version}; if ($self->module_name) { --- 654,658 ---- my $p = $self->{properties}; ! return $p->{dist_version} if defined $p->{dist_version}; if ($self->module_name) { *************** *** 583,587 **** my $p = $self->{properties}; my $member = "dist_$part"; ! return $p->{$member} if exists $p->{$member}; return unless $p->{dist_version_from}; --- 676,680 ---- my $p = $self->{properties}; my $member = "dist_$part"; ! return $p->{$member} if defined $p->{$member}; return unless $p->{dist_version_from}; *************** *** 1128,1133 **** . " option of the same name" if $self->valid_property($k); - # XXX Are there other options we should check? Contents of - # %additive elsewhere in this package? push @specs, $k . (defined $v->{type} ? $v->{type} : ''); push @specs, $v->{store} if exists $v->{store}; --- 1221,1224 ---- *************** *** 1182,1190 **** $args{ARGV} = \@argv; - # 'config' and 'install_path' are additive by hash key - my %additive = map {$_, 1} qw(config install_path); - # Hashify these parameters ! for (keys %additive) { next unless exists $args{$_}; my %hash; --- 1273,1278 ---- $args{ARGV} = \@argv; # Hashify these parameters ! for ($self->hash_properties) { next unless exists $args{$_}; my %hash; *************** *** 1209,1220 **** sub merge_args { my ($self, $action, %args) = @_; - my %additive = (config => $self->{config}, - install_path => $self->{properties}{install_path}); - $self->{action} = $action if defined $action; # Extract our 'properties' from $cmd_args, the rest are put in 'args'. while (my ($key, $val) = each %args) { ! my $add_to = ($additive{$key} ? $additive{$key} : $self->valid_property($key) ? $self->{properties} : $self->{args}); --- 1297,1308 ---- sub merge_args { my ($self, $action, %args) = @_; $self->{action} = $action if defined $action; + my %additive = map { $_ => 1 } $self->hash_properties; + # Extract our 'properties' from $cmd_args, the rest are put in 'args'. while (my ($key, $val) = each %args) { ! my $add_to = ( $key eq 'config' ? $self->{config} ! : $additive{$key} ? $self->{properties}{$key} : $self->valid_property($key) ? $self->{properties} : $self->{args}); |
From: Ken W. <kwi...@us...> - 2004-12-13 04:39:44
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8908 Modified Files: Tag: release-0_26_branch Changes Log Message: Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.299.2.21 retrieving revision 1.299.2.22 diff -C2 -d -r1.299.2.21 -r1.299.2.22 *** Changes 12 Dec 2004 04:09:42 -0000 1.299.2.21 --- Changes 13 Dec 2004 04:39:34 -0000 1.299.2.22 *************** *** 7,10 **** --- 7,16 ---- aren't part of the default compiled-in @INC. [Michael Schwern] + - The run_perl_script() method will now propagate any extra entries + in @INC (such as those added by "use lib" or the -I command-line + switch) to the subprocess. This helps situations in which you want + to tell the subprocess where to find a certain module, for + instance. [Michael Schwern] + 0.2606 (Bug fix for 0.26) Tue Dec 7 22:33:11 CST 2004 |
From: Ken W. <kwi...@us...> - 2004-12-13 04:37:56
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8614/lib/Module/Build Modified Files: Base.pm Log Message: Integrate from branch Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.360 retrieving revision 1.361 diff -C2 -d -r1.360 -r1.361 *** Base.pm 12 Dec 2004 04:12:19 -0000 1.360 --- Base.pm 13 Dec 2004 04:37:42 -0000 1.361 *************** *** 965,969 **** # Return any directories in @INC which are not in the default @INC for ! # this Perl. For example, stuff passed in with -I or loaded with "use lib". sub _added_to_INC { my $self = shift; --- 965,969 ---- # Return any directories in @INC which are not in the default @INC for ! # this perl. For example, stuff passed in with -I or loaded with "use lib". sub _added_to_INC { my $self = shift; *************** *** 980,986 **** local $ENV{PERL5LIB}; # this is not considered part of the default. ! my $perl = $self->perl; ! my @inc =`$perl -le "print for \@INC"`; chomp @inc; --- 980,986 ---- local $ENV{PERL5LIB}; # this is not considered part of the default. ! my $perl = ref($self) ? $self->perl : $self->find_perl_interpreter; ! my @inc = `$perl -le "print for \@INC"`; chomp @inc; *************** *** 1480,1484 **** while (my ($file, $to) = each %$files) { - local $ENV{'PERL5LIB'} = join $self->{config}{path_sep}, @INC; unless ($self->up_to_date( $file, $to )) { $self->run_perl_script($file, [], [@$to]); --- 1480,1483 ---- *************** *** 2120,2124 **** # XXX could be different names for scripts - local $ENV{'PERL5LIB'} = join $self->{config}{path_sep}, @INC; $self->run_perl_script('Build.PL') or die "Error executing 'Build.PL' in dist directory: $!"; $self->run_perl_script('Build') or die "Error executing 'Build' in dist directory: $!"; --- 2119,2122 ---- *************** *** 2628,2632 **** } my $perl = ref($self) ? $self->perl : $self->find_perl_interpreter; ! return $self->do_system($perl, @$preargs, $script, @$postargs); } --- 2626,2634 ---- } my $perl = ref($self) ? $self->perl : $self->find_perl_interpreter; ! ! # Make sure our local additions to @INC are propagated to the subprocess ! my $c = ref $self ? $self->config : \%Config::Config; ! local $ENV{PERL5LIB} = join $c->{path_sep}, $self->_added_to_INC; ! return $self->do_system($perl, @$preargs, $script, @$postargs); } |
From: Ken W. <kwi...@us...> - 2004-12-13 04:37:54
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8614/t Modified Files: ext.t Log Message: Integrate from branch Index: ext.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/ext.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ext.t 6 Dec 2004 04:01:19 -0000 1.5 --- ext.t 13 Dec 2004 04:37:44 -0000 1.6 *************** *** 2,5 **** --- 2,8 ---- use strict; use Test; + use File::Spec; + + require File::Spec->catfile('t', 'common.pl'); my @unix_splits = *************** *** 52,56 **** ); ! plan tests => 12 + 2*@unix_splits + 2*@win_splits; use Module::Build; --- 55,59 ---- ); ! plan tests => 13 + 2*@unix_splits + 2*@win_splits; use Module::Build; *************** *** 88,91 **** --- 91,101 ---- } + { + # Make sure run_perl_script() propagates @INC + local @INC = ('whosiewhatzit', @INC); + my $output = stdout_of( sub { Module::Build->run_perl_script('', ['-le', 'print for @INC']) } ); + ok $output, qr{^whosiewhatzit}m; + } + ################################################################## sub do_split_tests { |