module-build-checkins Mailing List for Module::Build (Page 31)
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-03-31 03:21:03
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10768/lib/Module/Build Modified Files: Base.pm Log Message: 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 options to ignore the fatal errors. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.400 retrieving revision 1.401 diff -u -d -r1.400 -r1.401 --- Base.pm 24 Mar 2005 16:36:09 -0000 1.400 +++ Base.pm 31 Mar 2005 03:20:18 -0000 1.401 @@ -27,13 +27,13 @@ die "Too early to specify a build action '$self->{action}'. Do 'Build $self->{action}' instead.\n" if $self->{action}; - $self->_set_install_paths; - $self->_find_nested_builds; $self->dist_name; + $self->dist_version; $self->check_manifest; $self->check_prereq; $self->set_autofeatures; - $self->dist_version; + $self->_set_install_paths; + $self->_find_nested_builds; return $self; } @@ -426,16 +426,12 @@ __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(config => {}); __PACKAGE__->add_property(recurse_into => []); __PACKAGE__->add_property(build_class => 'Module::Build'); __PACKAGE__->add_property(html_css => ($^O =~ /Win32/) ? 'Active.css' : ''); @@ -473,8 +469,28 @@ libdoc_dirs get_options quiet + ignore_prereq_conflicts + ignore_prereq_requires + ignore_prereqs ); +INIT { + 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. my @in_stack = (shift); @@ -657,7 +673,7 @@ File::Path::mkpath($self->{properties}{config_dir}); -d $self->{properties}{config_dir} or die "Can't mkdir $self->{properties}{config_dir}: $!"; - my @items = qw(requires build_requires conflicts recommends); + my @items = @{ $self->prereq_action_types }; $self->_write_dumper('prereqs', { map { $_, $self->$_() } @items }); $self->_write_dumper('build_params', [$self->{args}, $self->{config}, $self->{properties}]); @@ -680,7 +696,7 @@ my $failures = $self->prereq_failures($info); if ($failures) { $self->log_warn("Feature '$name' disabled because of the following prerequisite failures:\n"); - foreach my $type (qw(requires build_requires conflicts recommends)) { + foreach my $type ( @{$self->prereq_action_types} ) { next unless $failures->{$type}; while (my ($module, $status) = each %{$failures->{$type}}) { $self->log_warn(" * $status->{message}\n"); @@ -697,7 +713,7 @@ sub prereq_failures { my ($self, $info) = @_; - my @types = qw(requires recommends build_requires conflicts); + my @types = @{ $self->prereq_action_types }; $info ||= {map {$_, $self->$_()} @types}; @@ -708,12 +724,12 @@ while ( my ($modname, $spec) = each %$prereqs ) { my $status = $self->check_installed_status($modname, $spec); - if ($type eq 'conflicts') { + if ($type =~ /conflicts$/) { next if !$status->{ok}; $status->{conflicts} = delete $status->{need}; $status->{message} = "Installed version '$status->{have}' of $modname conflicts with this distribution"; - } elsif ($type eq 'recommends') { + } elsif ($type =~ /recommends$/) { next if $status->{ok}; $status->{message} = ($status->{have} eq '<none>' ? "Optional prerequisite $modname isn't installed" @@ -735,9 +751,9 @@ my $failures = $self->prereq_failures; return 1 unless $failures; - foreach my $type (qw(requires build_requires conflicts recommends)) { + foreach my $type ( @{$self->prereq_action_types} ) { next unless $failures->{$type}; - my $prefix = $type eq 'recommends' ? '' : 'ERROR: '; + my $prefix = $type =~ /recommends$/ ? '' : 'ERROR: '; while (my ($module, $status) = each %{$failures->{$type}}) { $self->log_warn(" * $prefix$status->{message}\n"); } @@ -1007,12 +1023,54 @@ sub _call_action { my ($self, $action) = @_; return if $self->{_completed_actions}{$action}++; + + $self->validate_action_prereqs( $action ); + local $self->{action} = $action; my $method = "ACTION_$action"; die "No action '$action' defined, try running the 'help' action.\n" unless $self->can($method); 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 ({}, @_); @@ -2239,7 +2297,7 @@ $node->{$name} = $self->$_(); } - foreach (qw(requires recommends build_requires conflicts)) { + foreach ( @{$self->prereq_action_types} ) { $node->{$_} = $p->{$_} if exists $p->{$_} and keys %{ $p->{$_} }; } |
From: Randy W. S. <si...@us...> - 2005-03-31 03:20:49
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10768 Modified Files: Changes Log Message: 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 options to ignore the fatal errors. Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.333 retrieving revision 1.334 diff -u -d -r1.333 -r1.334 --- Changes 23 Mar 2005 01:31:10 -0000 1.333 +++ Changes 31 Mar 2005 03:20:20 -0000 1.334 @@ -3,6 +3,11 @@ 0.27_01 (Beta for 0.28) + - 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 options to ignore the fatal errors. + - new_from_context() was losing its arguments in some cases (and not because of inadequate training in debate) - we now pass its arguments directly to the Build.PL script rather than merging them |
From: Ken W. <ke...@ma...> - 2005-03-25 21:39:55
|
When I committed a recent change to CVS, I got the following message from sourceforge's SMTP server: smtplib.SMTPSenderRefused: (452, 'Space shortage, please try later', 'kwi...@pr...') Here's a summary of the change I committed: "Move the mammoth write_config_data() method to the Notes class" Index: lib/Module/Build/Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.399 retrieving revision 1.400 diff -u -r1.399 -r1.400 --- lib/Module/Build/Base.pm 24 Mar 2005 04:52:42 -0000 1.399 +++ lib/Module/Build/Base.pm 24 Mar 2005 16:36:09 -0000 1.400 @@ -319,137 +319,15 @@ $self->log_info("Writing config notes to $notes_pm\n"); File::Path::mkpath(File::Basename::dirname($notes_pm)); - my $fh = IO::File->new("> $notes_pm") or die "Can't create '$notes_pm': $!"; - printf $fh <<'EOF', $notes_name; -package %s; -use strict; -my $arrayref = eval do {local $/; <DATA>} - or die "Couldn't load ConfigData data: $@"; -close DATA; -my ($config, $features) = @$arrayref; - -sub config { $config->{$_[1]} } -sub feature { $features->{$_[1]} } - -sub set_config { $config->{$_[1]} = $_[2] } -sub set_feature { $features->{$_[1]} = 0+!!$_[2] } - -sub feature_names { keys %%$features } -sub config_names { keys %%$config } - -sub write { - my $me = __FILE__; - require IO::File; - require Data::Dumper; - - my $mode_orig = (stat $me)[2] & 07777; - chmod($mode_orig | 0222, $me); # Make it writeable - my $fh = IO::File->new($me, 'r+') or die "Can't rewrite $me: $!"; - seek($fh, 0, 0); - while (<$fh>) { - last if /^__DATA__$/; - } - die "Couldn't find __DATA__ token in $me" if eof($fh); - - local $Data::Dumper::Terse = 1; - seek($fh, tell($fh), 0); - $fh->print( Data::Dumper::Dumper([$config, $features]) ); - truncate($fh, tell($fh)); - $fh->close; - - chmod($mode_orig, $me) - or warn "Couldn't restore permissions on $me: $!"; -} - -EOF - - printf $fh <<"EOF", $notes_name, $module_name; - -=head1 NAME - -$notes_name - Configuration for $module_name - -=head1 SYNOPSIS - - use $notes_name; - \$value = $notes_name->config('foo'); - \$value = $notes_name->feature('bar'); - - \@names = $notes_name->config_names; - \@names = $notes_name->feature_names; - - $notes_name->set_config(foo => \$new_value); - $notes_name->set_feature(bar => \$new_value); - $notes_name->write; # Save changes - -=head1 DESCRIPTION - -This module holds the configuration data for the C<$module_name> -module. It also provides a programmatic interface for getting or -setting that configuration data. Note that in order to actually make -changes, you'll have to have write access to the C<$notes_name> -module, and you should attempt to understand the repercussions of your -actions. - -=head1 METHODS - -=over 4 - -=item config(\$name) - -Given a string argument, returns the value of the configuration item -by that name, or C<undef> if no such item exists. - -=item feature(\$name) - -Given a string argument, returns the value of the feature by that -name, or C<undef> if no such feature exists. - -=item set_config(\$name, \$value) - -Sets the configuration item with the given name to the given value. -The value may be any Perl scalar that will serialize correctly using -C<Data::Dumper>. This includes references, objects (usually), and -complex data structures. It probably does not include transient -things like filehandles or sockets. - -=item set_feature(\$name, \$value) - -Sets the feature with the given name to the given boolean value. The -value will be converted to 0 or 1 automatically. - -=item config_names() - -Returns a list of all the names of config items currently defined in -C<$notes_name>, or in scalar context the number of items. - -=item feature_names() - -Returns a list of all the names of features currently defined in -C<$notes_name>, or in scalar context the number of features. - -=item write() - -Commits any changes from C<set_config()> and C<set_feature()> to disk. -Requires write access to the C<$notes_name> module. - -=back - -=head1 AUTHOR - -C<$notes_name> was automatically created using C<Module::Build>. -C<Module::Build> was written by Ken Williams, but he holds no -authorship claim or copyright claim to the contents of C<$notes_name>. - -=cut - -__DATA__ - -EOF - - local $Data::Dumper::Terse = 1; - print $fh Data::Dumper::Dumper([scalar $self->config_data, scalar $self->feature]); + Module::Build::Notes->write_config_data + ( + file => $notes_pm, + module => $module_name, + config_module => $notes_name, + config_data => scalar $self->config_data, + feature => scalar $self->feature, + ); } { Index: lib/Module/Build/Notes.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Notes.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- lib/Module/Build/Notes.pm 24 Mar 2005 04:52:44 -0000 1.2 +++ lib/Module/Build/Notes.pm 24 Mar 2005 16:36:09 -0000 1.3 @@ -6,6 +6,8 @@ use Data::Dumper; use IO::File; +use Carp; BEGIN{ $SIG{__DIE__} = \&carp::confess } + sub new { my ($class, %args) = @_; my $file = delete $args{file} or die "Missing required parameter 'file' to new()"; @@ -95,4 +97,141 @@ print $fh Data::Dumper::Dumper($data); } +sub write_config_data { + my ($self, %args) = @_; + + my $fh = IO::File->new("> $args{file}") or die "Can't create '$args{file}': $!"; + + printf $fh <<'EOF', $args{config_module}; +package %s; +use strict; +my $arrayref = eval do {local $/; <DATA>} + or die "Couldn't load ConfigData data: $@"; +close DATA; +my ($config, $features) = @$arrayref; + +sub config { $config->{$_[1]} } +sub feature { $features->{$_[1]} } + +sub set_config { $config->{$_[1]} = $_[2] } +sub set_feature { $features->{$_[1]} = 0+!!$_[2] } + +sub feature_names { keys %%$features } +sub config_names { keys %%$config } + +sub write { + my $me = __FILE__; + require IO::File; + require Data::Dumper; + + my $mode_orig = (stat $me)[2] & 07777; + chmod($mode_orig | 0222, $me); # Make it writeable + my $fh = IO::File->new($me, 'r+') or die "Can't rewrite $me: $!"; + seek($fh, 0, 0); + while (<$fh>) { + last if /^__DATA__$/; + } + die "Couldn't find __DATA__ token in $me" if eof($fh); + + local $Data::Dumper::Terse = 1; + seek($fh, tell($fh), 0); + $fh->print( Data::Dumper::Dumper([$config, $features]) ); + truncate($fh, tell($fh)); + $fh->close; + + chmod($mode_orig, $me) + or warn "Couldn't restore permissions on $me: $!"; +} + +EOF + + my ($module_name, $notes_name) = ($args{module}, $args{config_module}); + printf $fh <<"EOF", $notes_name, $module_name; + +=head1 NAME + +$notes_name - Configuration for $module_name + +=head1 SYNOPSIS + + use $notes_name; + \$value = $notes_name->config('foo'); + \$value = $notes_name->feature('bar'); + + \@names = $notes_name->config_names; + \@names = $notes_name->feature_names; + + $notes_name->set_config(foo => \$new_value); + $notes_name->set_feature(bar => \$new_value); + $notes_name->write; # Save changes + +=head1 DESCRIPTION + +This module holds the configuration data for the C<$module_name> +module. It also provides a programmatic interface for getting or +setting that configuration data. Note that in order to actually make +changes, you'll have to have write access to the C<$notes_name> +module, and you should attempt to understand the repercussions of your +actions. + +=head1 METHODS + +=over 4 + +=item config(\$name) + +Given a string argument, returns the value of the configuration item +by that name, or C<undef> if no such item exists. + +=item feature(\$name) + +Given a string argument, returns the value of the feature by that +name, or C<undef> if no such feature exists. + +=item set_config(\$name, \$value) + +Sets the configuration item with the given name to the given value. +The value may be any Perl scalar that will serialize correctly using +C<Data::Dumper>. This includes references, objects (usually), and +complex data structures. It probably does not include transient +things like filehandles or sockets. + +=item set_feature(\$name, \$value) + +Sets the feature with the given name to the given boolean value. The +value will be converted to 0 or 1 automatically. + +=item config_names() + +Returns a list of all the names of config items currently defined in +C<$notes_name>, or in scalar context the number of items. + +=item feature_names() + +Returns a list of all the names of features currently defined in +C<$notes_name>, or in scalar context the number of features. + +=item write() + +Commits any changes from C<set_config()> and C<set_feature()> to disk. +Requires write access to the C<$notes_name> module. + +=back + +=head1 AUTHOR + +C<$notes_name> was automatically created using C<Module::Build>. +C<Module::Build> was written by Ken Williams, but he holds no +authorship claim or copyright claim to the contents of C<$notes_name>. + +=cut + +__DATA__ + +EOF + + local $Data::Dumper::Terse = 1; + print $fh Data::Dumper::Dumper([$args{config_data}, $args{feature}]); +} + 1; |
From: Ken W. <kwi...@us...> - 2005-03-24 04:52:54
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7750/lib/Module/Build Modified Files: Base.pm Notes.pm Log Message: Use the Notes class for persistent hashes Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.398 retrieving revision 1.399 diff -u -d -r1.398 -r1.399 --- Base.pm 23 Mar 2005 01:30:53 -0000 1.398 +++ Base.pm 24 Mar 2005 04:52:42 -0000 1.399 @@ -14,7 +14,9 @@ use Text::ParseWords (); use Carp (); -require Module::Build::ModuleInfo; +use Module::Build::ModuleInfo; +use Module::Build::Notes; + #################### Constructors ########################### sub new { @@ -103,10 +105,17 @@ mb_version => $Module::Build::VERSION, %input, }, + phash => {}, }, $package; $self->_set_defaults; - my ($p, $c) = ($self->{properties}, $self->{config}); + my ($p, $c, $ph) = ($self->{properties}, $self->{config}, $self->{phash}); + + foreach (qw(notes config_data features runtime_params cleanup)) { + my $file = File::Spec->catfile($self->config_dir, $_); + $ph->{$_} = Module::Build::Notes->new(file => $file); + $ph->{$_}->restore if -e $file; + } # The following warning could be unnecessary if the user is running # an embedded perl, but there aren't too many of those around, and @@ -286,23 +295,10 @@ } } -sub _general_notes { - my $self = shift; - my $type = shift; - return $self->_persistent_hash_read($type) unless @_; - - my $key = shift; - return $self->_persistent_hash_read($type, $key) unless @_; - - my $value = shift; - $self->has_config_data(1) if $type =~ /^(config_data|features)$/; - return $self->_persistent_hash_write($type, { $key => $value }); -} - -sub notes { shift()->_general_notes('notes', @_) } -sub config_data { shift()->_general_notes('config_data', @_) } -sub feature { shift()->_general_notes('features', @_) } -sub runtime_params { shift->_persistent_hash_read('runtime_params', @_ ? shift : ()) } +sub notes { shift()->{phash}{notes}->access(@_) } +sub config_data { shift()->{phash}{config_data}->access(@_) } +sub feature { shift()->{phash}{features}->access(@_) } +sub runtime_params { shift->{phash}{runtime_params}->read( @_ ? shift : () ) } # Read-only sub current_action { shift->{action} } sub add_build_element { @@ -734,70 +730,15 @@ return Module::Build::ModuleInfo->find_module_by_name(@_[1,2]); } -sub _persistent_hash_write { - my ($self, $name, $href) = @_; - $href ||= {}; - my $ph = $self->{phash}{$name} ||= {disk => {}, new => {}}; - - @{$ph->{new}}{ keys %$href } = values %$href; # Merge - - # Do some optimization to avoid unnecessary writes - foreach my $key (keys %{ $ph->{new} }) { - next if ref $ph->{new}{$key}; - next if ref $ph->{disk}{$key} or !exists $ph->{disk}{$key}; - delete $ph->{new}{$key} if $ph->{new}{$key} eq $ph->{disk}{$key}; - } - - if (my $file = $self->config_file($name)) { - return if -e $file and !keys %{ $ph->{new} }; # Nothing to do - - @{$ph->{disk}}{ keys %{$ph->{new}} } = values %{$ph->{new}}; # Merge - $self->_write_dumper($name, $ph->{disk}); - - $ph->{new} = {}; - } - return $self->_persistent_hash_read($name); -} - -sub _persistent_hash_read { - my $self = shift; - my $name = shift; - my $ph = $self->{phash}{$name} ||= {disk => {}, new => {}}; - - if (@_) { - # Return 1 key as a scalar - my $key = shift; - return $ph->{new}{$key} if exists $ph->{new}{$key}; - return $ph->{disk}{$key}; - } else { - # Return all data - my $out = (keys %{$ph->{new}} - ? {%{$ph->{disk}}, %{$ph->{new}}} - : $ph->{disk}); - return wantarray ? %$out : $out; - } -} - -sub _persistent_hash_restore { - my ($self, $name) = @_; - my $ph = $self->{phash}{$name} ||= {disk => {}, new => {}}; - - my $file = $self->config_file($name) or die "No config file '$name'"; - my $fh = IO::File->new("< $file") or die "Can't read $file: $!"; - - $ph->{disk} = eval do {local $/; <$fh>}; - die $@ if $@; -} - sub add_to_cleanup { my $self = shift; my %files = map {$self->localize_file_path($_), 1} @_; - $self->_persistent_hash_write('cleanup', \%files); + $self->{phash}{cleanup}->write(\%files); } sub cleanup { my $self = shift; - my $all = $self->_persistent_hash_read('cleanup'); + my $all = $self->{phash}{cleanup}->read; return keys %$all; } @@ -816,12 +757,11 @@ die if $@; ($self->{args}, $self->{config}, $self->{properties}) = @$ref; close $fh; +} - for (qw(cleanup notes features config_data runtime_params)) { - next unless -e $self->config_file($_); - $self->_persistent_hash_restore($_); - } - $self->has_config_data(1) if keys(%{$self->config_data}) || keys(%{$self->feature}); +sub has_config_data { + my $self = shift; + return scalar grep $self->{phash}{$_}->has_data(), qw(config_data features); } sub _write_dumper { @@ -843,7 +783,7 @@ $self->_write_dumper('prereqs', { map { $_, $self->$_() } @items }); $self->_write_dumper('build_params', [$self->{args}, $self->{config}, $self->{properties}]); - $self->_persistent_hash_write($_) foreach qw(notes cleanup features config_data runtime_params); + $self->{phash}{$_}->write() foreach qw(notes cleanup features config_data runtime_params); } sub config { shift()->{config} } @@ -1306,7 +1246,7 @@ # Extract our 'properties' from $cmd_args, the rest are put in 'args'. while (my ($key, $val) = each %args) { - $self->_persistent_hash_write('runtime_params', { $key => $val }) + $self->{phash}{runtime_params}->access( $key => $val ) if $self->valid_property($key); my $add_to = ( $key eq 'config' ? $self->{config} : $additive{$key} ? $self->{properties}{$key} Index: Notes.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Notes.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Notes.pm 23 Mar 2005 21:04:05 -0000 1.1 +++ Notes.pm 24 Mar 2005 04:52:44 -0000 1.2 @@ -7,22 +7,23 @@ use IO::File; sub new { - my $class = shift; - return bless { - disk => {}, - new => {}, - @_, - }, $class; + my ($class, %args) = @_; + my $file = delete $args{file} or die "Missing required parameter 'file' to new()"; + my $self = bless { + disk => {}, + new => {}, + file => $file, + %args, + }, $class; } sub restore { - my ($class, $file) = @_; - my $self = $class->new( file => $file ); + my $self = shift; - my $fh = IO::File->new("< $file") or die "Can't read $file: $!"; + my $fh = IO::File->new("< $self->{file}") or die "Can't read $self->{file}: $!"; $self->{disk} = eval do {local $/; <$fh>}; die $@ if $@; - return $self; + $self->{new} = {}; } sub access { @@ -72,6 +73,10 @@ } if (my $file = $self->{file}) { + my ($vol, $dir, $base) = File::Spec->splitpath($file); + $dir = File::Spec->catpath($vol, $dir, ''); + return unless -e $dir && -d $dir; # The user needs to arrange for this + return if -e $file and !keys %{ $self->{new} }; # Nothing to do @{$self->{disk}}{ keys %{$self->{new}} } = values %{$self->{new}}; # Merge |
From: Randy W. S. <si...@us...> - 2005-03-24 01:48:38
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8010/t Modified Files: Tag: release-0_26_branch xs.t Log Message: Capture shell error message when compiler is not found. Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -u -d -r1.14.2.1 -r1.14.2.2 --- xs.t 7 Jan 2005 02:17:42 -0000 1.14.2.1 +++ xs.t 24 Mar 2005 01:48:27 -0000 1.14.2.2 @@ -6,12 +6,18 @@ use Module::Build; use File::Spec; -print("1..0 # Skipped: no compiler found\n"), exit(0) unless Module::Build->current->have_c_compiler; -plan tests => 12; - my $common_pl = File::Spec->catfile('t', 'common.pl'); require $common_pl; +{ local $SIG{__WARN__} = sub {}; + + my $have_c_compiler; + stderr_of( sub {$have_c_compiler = Module::Build->current->have_c_compiler} ); + print("1..0 # Skipped: no compiler found\n"), exit(0) unless $have_c_compiler; +} + +plan tests => 12; + ######################### End of black magic. # Pretend we're in the t/XSTest/ subdirectory |
From: Randy W. S. <si...@us...> - 2005-03-24 01:44:48
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5963/t Modified Files: xs.t Log Message: Capture shell error message when compiler is not found. Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- xs.t 24 Mar 2005 01:16:59 -0000 1.17 +++ xs.t 24 Mar 2005 01:44:34 -0000 1.18 @@ -6,11 +6,18 @@ use Module::Build; use File::Spec; +my $common_pl = File::Spec->catfile('t', 'common.pl'); +require $common_pl; + { local $SIG{__WARN__} = sub {}; - if ( !Module::Build->current->feature('C_support') ) { + + my $have_c_compiler; + stderr_of( sub {$have_c_compiler = Module::Build->current->have_c_compiler} ); + + if ( !Module::Build->current->feature('C_support') ) { print("1..0 # Skipped: C_support not enabled\n"); exit(0); - } elsif ( !Module::Build->current->have_c_compiler ) { + } elsif ( !$have_c_compiler ) { print("1..0 # Skipped: C_support enabled, but no compiler found\n"); exit(0); } @@ -18,9 +25,6 @@ plan tests => 12; -my $common_pl = File::Spec->catfile('t', 'common.pl'); -require $common_pl; - ######################### End of black magic. # Pretend we're in the t/XSTest/ subdirectory |
From: Randy W. S. <si...@us...> - 2005-03-24 01:17:24
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26087/t Modified Files: xs.t Log Message: Test for have_c_compiler in addition to feature('C_support') since the feature can be enabled when the compiler is no longer present or can't be found in the PATH. Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- xs.t 7 Jan 2005 10:15:54 -0000 1.16 +++ xs.t 24 Mar 2005 01:16:59 -0000 1.17 @@ -6,7 +6,16 @@ use Module::Build; use File::Spec; -print("1..0 # Skipped: C_support not enabled\n"), exit(0) unless Module::Build->current->feature('C_support'); +{ local $SIG{__WARN__} = sub {}; + if ( !Module::Build->current->feature('C_support') ) { + print("1..0 # Skipped: C_support not enabled\n"); + exit(0); + } elsif ( !Module::Build->current->have_c_compiler ) { + print("1..0 # Skipped: C_support enabled, but no compiler found\n"); + exit(0); + } +} + plan tests => 12; my $common_pl = File::Spec->catfile('t', 'common.pl'); |
From: Randy W. S. <si...@us...> - 2005-03-24 00:06:48
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28065/lib/Module Modified Files: Build.pm Log Message: Document usage of the environment variable $DEVEL_COVER_OPTIONS to pass arguments to Devel::Cover for the 'testcover' action. [Thomas Klausner] Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.174 retrieving revision 1.175 diff -u -d -r1.174 -r1.175 --- Build.pm 27 Feb 2005 14:45:17 -0000 1.174 +++ Build.pm 24 Mar 2005 00:06:18 -0000 1.175 @@ -444,6 +444,11 @@ code-coverage report showing which parts of the code were actually exercised during the tests. +To pass options to C<Devel::Cover>, set the C<$DEVEL_COVER_OPTIONS> +environment variable: + + DEVEL_COVER_OPTIONS=-ignore,Build ./Build testcover + =item testdb This is a synonym for the 'test' action with the C<debugger=1> |
From: Randy W. S. <si...@us...> - 2005-03-24 00:05:27
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27216/lib/Module Modified Files: Tag: release-0_26_branch Build.pm Log Message: Document usage of the environment variable $DEVEL_COVER_OPTIONS to pass arguments to Devel::Cover for the 'testcover' action. [Thomas Klausner] Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.164.2.13 retrieving revision 1.164.2.14 diff -u -d -r1.164.2.13 -r1.164.2.14 --- Build.pm 17 Mar 2005 04:17:32 -0000 1.164.2.13 +++ Build.pm 24 Mar 2005 00:04:40 -0000 1.164.2.14 @@ -1303,6 +1303,11 @@ code-coverage report showing which parts of the code were actually exercised during the tests. +To pass options to C<Devel::Cover>, set the C<$DEVEL_COVER_OPTIONS> +environment variable: + + DEVEL_COVER_OPTIONS=-ignore,Build ./Build testcover + =item testdb This is a synonym for the 'test' action with the C<debugger=1> |
From: Ken W. <kwi...@us...> - 2005-03-23 21:04:17
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10401/lib/Module/Build Added Files: Notes.pm Log Message: First shot at splitting out notes-hashes into their own class --- NEW FILE: Notes.pm --- package Module::Build::Notes; # A class for persistent hashes use strict; use Data::Dumper; use IO::File; sub new { my $class = shift; return bless { disk => {}, new => {}, @_, }, $class; } sub restore { my ($class, $file) = @_; my $self = $class->new( file => $file ); my $fh = IO::File->new("< $file") or die "Can't read $file: $!"; $self->{disk} = eval do {local $/; <$fh>}; die $@ if $@; return $self; } sub access { my $self = shift; return $self->read() unless @_; my $key = shift; return $self->read($key) unless @_; my $value = shift; return $self->write({ $key => $value }); } sub has_data { my $self = shift; return keys %{$self->read()} > 0; } sub read { my $self = shift; if (@_) { # Return 1 key as a scalar my $key = shift; return $self->{new}{$key} if exists $self->{new}{$key}; return $self->{disk}{$key}; } # Return all data my $out = (keys %{$self->{new}} ? {%{$self->{disk}}, %{$self->{new}}} : $self->{disk}); return wantarray ? %$out : $out; } sub write { my ($self, $href) = @_; $href ||= {}; @{$self->{new}}{ keys %$href } = values %$href; # Merge # Do some optimization to avoid unnecessary writes foreach my $key (keys %{ $self->{new} }) { next if ref $self->{new}{$key}; next if ref $self->{disk}{$key} or !exists $self->{disk}{$key}; delete $self->{new}{$key} if $self->{new}{$key} eq $self->{disk}{$key}; } if (my $file = $self->{file}) { return if -e $file and !keys %{ $self->{new} }; # Nothing to do @{$self->{disk}}{ keys %{$self->{new}} } = values %{$self->{new}}; # Merge $self->_dump($file, $self->{disk}); $self->{new} = {}; } return $self->read; } sub _dump { my ($self, $file, $data) = @_; my $fh = IO::File->new("> $file") or die "Can't create '$file': $!"; local $Data::Dumper::Terse = 1; print $fh Data::Dumper::Dumper($data); } 1; |
From: Ken W. <kwi...@us...> - 2005-03-23 01:53:48
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16582 Modified Files: extend.t Log Message: Convert to Test::More Index: extend.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/extend.t,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- extend.t 15 Dec 2004 21:32:48 -0000 1.8 +++ extend.t 23 Mar 2005 01:53:23 -0000 1.9 @@ -2,8 +2,7 @@ # Tests various ways to extend Module::Build, e.g. by subclassing. -use Test; -BEGIN { plan tests => 45 } +use Test::More tests => 45; use Module::Build; ok 1; @@ -21,7 +20,7 @@ ok $build; $build->dispatch('loop'); -ok $::x, 1; +is $::x, 1; $build->dispatch('realclean'); @@ -36,9 +35,9 @@ # Make sure order is preserved $build->test_files('foo', 'bar'); $files = $build->test_files; - ok @$files, 2; - ok $files->[0], 'foo'; - ok $files->[1], 'bar'; + is @$files, 2; + is $files->[0], 'foo'; + is $files->[1], 'bar'; } @@ -51,7 +50,7 @@ $build->add_build_element('foo'); $build->dispatch('build'); - ok -e File::Spec->catfile($build->blib, 'lib', 'test.foo'); + is -e File::Spec->catfile($build->blib, 'lib', 'test.foo'), 1; $build->dispatch('realclean'); } @@ -59,7 +58,7 @@ { package MBSub; - use Test; + use Test::More; use vars qw($VERSION @ISA); @ISA = qw(Module::Build); $VERSION = 0.01; @@ -74,12 +73,12 @@ # Catch an exception adding an existing property. eval { __PACKAGE__->add_property('module_name')}; - ok "$@", qr/Property "module_name" already exists/; + like "$@", qr/Property "module_name" already exists/; } { package MBSub2; - use Test; + use Test::More; use vars qw($VERSION @ISA); @ISA = qw(Module::Build); $VERSION = 0.01; @@ -93,25 +92,22 @@ 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'); + isa_ok $build, 'Module::Build'; + isa_ok $build, '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'); + can_ok $build, 'module_name'; # Check foo property. - ok !!$build->can('foo'); + can_ok $build, 'foo'; ok ! $build->foo; ok $build->foo(1); ok $build->foo; # Check bar property. - ok !!$build->can('bar'); - ok $build->bar, 'hey'; + can_ok $build, 'bar'; + is $build->bar, 'hey'; ok $build->bar('you'); - ok $build->bar, 'you'; + is $build->bar, 'you'; # Check hash property. ok $build = MBSub->new( @@ -119,10 +115,10 @@ hash => { foo => 'bar', bin => 'foo'} ); - ok !!$build->can('hash'); - ok ref $build->hash, 'HASH'; - ok $build->hash->{foo}, 'bar'; - ok $build->hash->{bin}, 'foo'; + can_ok $build, 'hash'; + isa_ok $build->hash, 'HASH'; + is $build->hash->{foo}, 'bar'; + is $build->hash->{bin}, 'foo'; # Check hash property passed via the command-line. { @@ -135,17 +131,17 @@ ); } - ok !!$build->can('hash'); - ok ref $build->hash, 'HASH'; - ok $build->hash->{foo}, 'bar'; - ok $build->hash->{bin}, 'foo'; + can_ok $build, 'hash'; + isa_ok $build->hash, 'HASH'; + is $build->hash->{foo}, 'bar'; + is $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'); + isa_ok $build, 'Module::Build'; + isa_ok $build, 'MBSub2'; ok $build->valid_property('bar'); - ok !!$build->can('bar'); - ok $build->bar, 'yow'; + can_ok $build, 'bar'; + is $build->bar, 'yow'; } |
From: Ken W. <kwi...@us...> - 2005-03-23 01:31:28
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3584 Modified Files: Changes Log Message: Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.332 retrieving revision 1.333 diff -u -d -r1.332 -r1.333 --- Changes 16 Feb 2005 12:38:57 -0000 1.332 +++ Changes 23 Mar 2005 01:31:10 -0000 1.333 @@ -24,6 +24,10 @@ - Refactored methods relating to parsing perl module files for package, version, and pod data into a new class: Module::Build::ModuleInfo. + - We now use Test::More for our regression tests. If the user + doesn't have it installed, we include a copy in t/lib/ that we can + use during testing (it won't be installed). + - Split documentation into two sections. The user level documentation and overview remains in 'Module/Build.pm', while a new document, 'Module/Build/Authoring.pod', has been created for module authors. |
From: Ken W. <kwi...@us...> - 2005-03-23 01:31:03
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3284/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.397 retrieving revision 1.398 diff -u -d -r1.397 -r1.398 --- Base.pm 10 Mar 2005 05:03:14 -0000 1.397 +++ Base.pm 23 Mar 2005 01:30:53 -0000 1.398 @@ -1266,6 +1266,8 @@ $self->_read_arg(\%args, $1, $2); } elsif ( /^--(\w+)$/ ) { $self->_read_arg(\%args, $1, shift()); + } elsif ( /^--(\w+)=(.*)$/ ) { + $self->_read_arg(\%args, $1, $2); } elsif ( /^(\w+)$/ and !defined($action)) { $action = $1; } else { |
From: Ken W. <kwi...@us...> - 2005-03-23 01:31:03
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3284/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.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ext.t 23 Feb 2005 11:59:13 -0000 1.14 +++ ext.t 23 Mar 2005 01:30:54 -0000 1.15 @@ -86,9 +86,9 @@ { # Make sure read_args() functions properly as a class method - my @args = qw(foo=bar --food bard); + my @args = qw(foo=bar --food bard --foods=bards); my ($args) = Module::Build->read_args(@args); - is_deeply($args, {foo => 'bar', food => 'bard', ARGV => []}); + is_deeply($args, {foo => 'bar', food => 'bard', foods => 'bards', ARGV => []}); } { |
From: Ken W. <kwi...@us...> - 2005-03-23 01:26:58
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv492/lib/Module/Build Modified Files: Tag: release-0_26_branch Base.pm Log Message: Accept --foo=bar as a synonym for --foo bar Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.340.2.29 retrieving revision 1.340.2.30 diff -u -d -r1.340.2.29 -r1.340.2.30 --- Base.pm 23 Mar 2005 01:16:56 -0000 1.340.2.29 +++ Base.pm 23 Mar 2005 01:26:23 -0000 1.340.2.30 @@ -1167,6 +1167,8 @@ $self->_read_arg(\%args, $1, $2); } elsif ( /^--(\w+)$/ ) { $self->_read_arg(\%args, $1, shift()); + } elsif ( /^--(\w+)=(.*)$/ ) { + $self->_read_arg(\%args, $1, $2); } elsif ( /^(\w+)$/ and !defined($action)) { $action = $1; } else { |
From: Ken W. <kwi...@us...> - 2005-03-23 01:26:58
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv492/t Modified Files: Tag: release-0_26_branch ext.t Log Message: Accept --foo=bar as a synonym for --foo bar Index: ext.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/ext.t,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -d -r1.1.2.6 -r1.1.2.7 --- ext.t 7 Jan 2005 02:17:42 -0000 1.1.2.6 +++ ext.t 23 Mar 2005 01:26:23 -0000 1.1.2.7 @@ -55,7 +55,7 @@ { 'a " b " c' => [ 'a', ' b ', 'c' ] }, ); -plan tests => 13 + 2*@unix_splits + 2*@win_splits; +plan tests => 14 + 2*@unix_splits + 2*@win_splits; use Module::Build; ok(1); @@ -81,12 +81,13 @@ { # Make sure read_args() functions properly as a class method - my @args = qw(foo=bar --food bard); + my @args = qw(foo=bar --food bard --foods=bards); my ($args) = Module::Build->read_args(@args); - ok keys(%$args), 3; + ok keys(%$args), 4; ok $args->{foo}, 'bar'; ok $args->{food}, 'bard'; + ok $args->{foods}, 'bards'; ok exists $args->{ARGV}, 1; ok @{$args->{ARGV}}, 0; } |
From: Ken W. <kwi...@us...> - 2005-03-23 01:26:31
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv492 Modified Files: Tag: release-0_26_branch Changes Log Message: Accept --foo=bar as a synonym for --foo bar Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.299.2.43 retrieving revision 1.299.2.44 diff -u -d -r1.299.2.43 -r1.299.2.44 --- Changes 21 Mar 2005 17:35:52 -0000 1.299.2.43 +++ Changes 23 Mar 2005 01:26:22 -0000 1.299.2.44 @@ -14,6 +14,11 @@ - Added a recipe to the cookbook showing how to run a single test file from the command line. [William McKee] + - For command-line arguments, we now accept the syntax "--foo=bar" in + addition to "--foo bar" and "foo=bar". This seems to fit well with + what GNU getopt and Getopt::Long do, and with people's + expectations. [Adam Spiers] + 0.2609 Wed Mar 16 22:18:35 CST 2005 - The html docs that were created during the first invokation of |
From: Ken W. <kwi...@us...> - 2005-03-23 01:17:07
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26889/t Modified Files: Tag: release-0_26_branch install.t Log Message: --install_path should override --install_base Index: install.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/install.t,v retrieving revision 1.12.2.3 retrieving revision 1.12.2.4 diff -u -d -r1.12.2.3 -r1.12.2.4 --- install.t 16 Mar 2005 16:51:42 -0000 1.12.2.3 +++ install.t 23 Mar 2005 01:16:56 -0000 1.12.2.4 @@ -1,7 +1,7 @@ use strict; use Test; -BEGIN { plan tests => 29 } +BEGIN { plan tests => 31 } use Module::Build; use File::Spec; use File::Path; @@ -130,11 +130,10 @@ '--install_base', $basedir])}; 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; - + my $relpath = $build->install_base_relative('script'); + $install_to = File::Spec->catfile($destdir, $basedir, $relpath, 'sample.pl'); + ok -e $install_to, 1, "Should install script as $install_to"; + eval {$build->dispatch('realclean')}; ok $@, ''; } @@ -156,6 +155,16 @@ ok keys %$pms, 0; } +{ + # Make sure install_path overrides install_base + my $build = new Module::Build( module_name => 'Sample', + install_base => 'foo', + install_path => { lib => 'bar' }, + license => 'perl' ); + ok $build; + ok $build->install_destination('lib'), 'bar'; +} + sub strip_volume { my $dir = shift; (undef, $dir) = File::Spec->splitpath( $dir, 1 ); |
From: Ken W. <kwi...@us...> - 2005-03-23 01:17:07
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26889/lib/Module/Build Modified Files: Tag: release-0_26_branch Base.pm Log Message: --install_path should override --install_base Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.340.2.28 retrieving revision 1.340.2.29 diff -u -d -r1.340.2.28 -r1.340.2.29 --- Base.pm 18 Mar 2005 16:22:58 -0000 1.340.2.28 +++ Base.pm 23 Mar 2005 01:16:56 -0000 1.340.2.29 @@ -2368,10 +2368,10 @@ my ($self, $type) = @_; my $p = $self->{properties}; + return $p->{install_path}{$type} if exists $p->{install_path}{$type}; 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}; } |
From: Randy W. S. <si...@us...> - 2005-03-22 06:39:40
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build/Platform In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3974/lib/Module/Build/Platform Modified Files: Tag: release-0_26_branch Windows.pm Log Message: Derive name of generated files from the basename of the output library, eliminating dependency on the module name. Index: Windows.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Windows.pm,v retrieving revision 1.13.2.6 retrieving revision 1.13.2.7 diff -u -d -r1.13.2.6 -r1.13.2.7 --- Windows.pm 2 Dec 2004 23:39:52 -0000 1.13.2.6 +++ Windows.pm 22 Mar 2005 06:39:31 -0000 1.13.2.7 @@ -115,12 +115,13 @@ my ($self, $to, $file_base) = @_; my ($cf, $p) = ($self->{config}, $self->{properties}); - my $mylib = File::Spec->catfile( - $to, File::Basename::basename("$file_base.$cf->{dlext}") ); + my $basename = File::Basename::basename( $file_base ); + my $mylib = File::Spec->catfile( $to, "$basename.$cf->{dlext}" ); my %spec = ( srcdir => File::Basename::dirname($file_base), builddir => $to, + basename => $basename, startup => [ ], objects => [ "$file_base$cf->{obj_ext}", @{$p->{objects} || []} ], libs => [ ], @@ -134,10 +135,6 @@ use_scripts => 1, # XXX provide user option to change this??? ); - unless ( $spec{basename} ) { - ($spec{basename} = $self->{properties}{module_name}) =~ s/.*:://; - } - $spec{srcdir} = File::Spec->canonpath( $spec{srcdir} ); $spec{builddir} = File::Spec->canonpath( $spec{builddir} ); |
From: Ken W. <kwi...@us...> - 2005-03-21 17:36:38
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9418/lib/Module/Build Modified Files: Cookbook.pm Log Message: Integrate from branch Index: Cookbook.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Cookbook.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Cookbook.pm 12 Nov 2004 02:27:00 -0000 1.12 +++ Cookbook.pm 21 Mar 2005 17:36:26 -0000 1.13 @@ -107,6 +107,24 @@ Build install destdir=/tmp/my-package-1.003 +=head2 Running a single test file + +C<Module::Builde> supports running a single test, which enables you to +track down errors more quickly. Use the following format: + + ./Build test --test_files t/mytest.t + +In addition, you may want to run the test in verbose mode to get more +informative output: + + ./Build test --test_files t/mytest.t --verbose 1 + +I run this so frequently that I actually define the following shell alias: + + alias t './Build test --verbose 1 --test_files' + +So then I can just execute C<t t/mytest.t> to run a single test. + =head1 ADVANCED RECIPES |
From: Ken W. <kwi...@us...> - 2005-03-21 17:36:11
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9158 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.42 retrieving revision 1.299.2.43 diff -u -d -r1.299.2.42 -r1.299.2.43 --- Changes 18 Mar 2005 16:22:57 -0000 1.299.2.42 +++ Changes 21 Mar 2005 17:35:52 -0000 1.299.2.43 @@ -11,6 +11,9 @@ forgotten and no ConfigData.pm module would get written. [Ray Zimmerman] + - Added a recipe to the cookbook showing how to run a single test + file from the command line. [William McKee] + 0.2609 Wed Mar 16 22:18:35 CST 2005 - The html docs that were created during the first invokation of |
From: Ken W. <kwi...@us...> - 2005-03-21 17:33:52
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8294/lib/Module/Build Modified Files: Tag: release-0_26_branch Cookbook.pm Log Message: Add recipe for running a single test file Index: Cookbook.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Cookbook.pm,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -d -r1.9 -r1.9.2.1 --- Cookbook.pm 9 Oct 2004 16:27:59 -0000 1.9 +++ Cookbook.pm 21 Mar 2005 17:33:40 -0000 1.9.2.1 @@ -107,6 +107,24 @@ Build install destdir=/tmp/my-package-1.003 +=head2 Running a single test file + +C<Module::Builde> supports running a single test, which enables you to +track down errors more quickly. Use the following format: + + ./Build test --test_files t/mytest.t + +In addition, you may want to run the test in verbose mode to get more +informative output: + + ./Build test --test_files t/mytest.t --verbose 1 + +I run this so frequently that I actually define the following shell alias: + + alias t './Build test --verbose 1 --test_files' + +So then I can just execute C<t t/mytest.t> to run a single test. + =head1 ADVANCED RECIPES |
From: Ken W. <kwi...@us...> - 2005-03-18 16:23:53
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9005 Modified Files: Tag: release-0_26_branch Changes Log Message: Integrate from mainline (was overlooked for the last release) Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.299.2.41 retrieving revision 1.299.2.42 diff -u -d -r1.299.2.41 -r1.299.2.42 --- Changes 17 Mar 2005 04:18:53 -0000 1.299.2.41 +++ Changes 18 Mar 2005 16:22:57 -0000 1.299.2.42 @@ -1,5 +1,16 @@ Revision history for Perl extension Module::Build. +0.2610 + + - new_from_context() was losing its arguments in some cases (and not + because of inadequate training in debate) - we now pass its + arguments directly to the Build.PL script rather than merging them + in afterwards. [Ray Zimmerman] + + - Fixed a bug in which config_data and feature data were being + forgotten and no ConfigData.pm module would get written. [Ray + Zimmerman] + 0.2609 Wed Mar 16 22:18:35 CST 2005 - The html docs that were created during the first invokation of |
From: Ken W. <kwi...@us...> - 2005-03-18 16:23:08
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9005/lib/Module/Build Modified Files: Tag: release-0_26_branch Base.pm Log Message: Integrate from mainline (was overlooked for the last release) Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.340.2.27 retrieving revision 1.340.2.28 diff -u -d -r1.340.2.27 -r1.340.2.28 --- Base.pm 10 Mar 2005 04:50:13 -0000 1.340.2.27 +++ Base.pm 18 Mar 2005 16:22:58 -0000 1.340.2.28 @@ -60,10 +60,8 @@ # XXX Read the META.yml and see whether we need to run the Build.PL # Run the Build.PL - $package->run_perl_script('Build.PL'); - my $self = $package->resume; - $self->merge_args(undef, %args); - return $self; + $package->run_perl_script('Build.PL', [], [$package->unparse_args(\%args)]); + return $package->resume; } sub current { @@ -723,6 +721,7 @@ next unless -e $self->config_file($_); $self->_persistent_hash_restore($_); } + $self->has_config_data(1) if keys(%{$self->config_data}) || keys(%{$self->feature}); } sub _write_dumper { @@ -1126,6 +1125,17 @@ return $args, @ARGV; } +sub unparse_args { + my ($self, $args) = @_; + my @out; + while (my ($k, $v) = each %$args) { + push @out, (UNIVERSAL::isa($v, 'HASH') ? map {+"--$k", "$_=$v->{$_}"} keys %$v : + UNIVERSAL::isa($v, 'ARRAY') ? map {+"--$k", $_} @$v : + ("--$k", $v)); + } + return @out; +} + sub args { my $self = shift; return wantarray ? %{ $self->{args} } : $self->{args} unless @_; |