[Module-build-checkins] Module-Build/lib/Module/Build Base.pm,1.562,1.563
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <kwi...@us...> - 2006-03-21 04:57:11
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23910/lib/Module/Build Modified Files: Base.pm Log Message: Make a little code simplification Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.562 retrieving revision 1.563 diff -u -d -r1.562 -r1.563 --- Base.pm 21 Mar 2006 04:51:34 -0000 1.562 +++ Base.pm 21 Mar 2006 04:57:06 -0000 1.563 @@ -3103,10 +3103,13 @@ my ($self, $node, $keys) = @_; my $p = $self->{properties}; + # If we aren't being asked for key order, just fake it + $keys ||= []; + foreach (qw(dist_name dist_version dist_author dist_abstract license)) { (my $name = $_) =~ s/^dist_//; $node->{$name} = $self->$_(); - push(@$keys, $name) if ($keys); + push(@$keys, $name); die "ERROR: Missing required field '$_' for META.yml\n" unless defined($node->{$name}) && length($node->{$name}); } @@ -3119,13 +3122,13 @@ foreach ( @{$self->prereq_action_types} ) { if (exists $p->{$_} and keys %{ $p->{$_} }) { $node->{$_} = $p->{$_}; - push(@$keys, $_) if ($keys); + push(@$keys, $_); } } if (exists $p->{dynamic_config}) { $node->{dynamic_config} = $p->{dynamic_config}; - push(@$keys, "dynamic_config") if ($keys); + push(@$keys, "dynamic_config"); } my $pkgs = eval { $self->find_dist_packages }; if ($@) { @@ -3137,7 +3140,7 @@ ; if (exists $p->{no_index}) { $node->{no_index} = $p->{no_index}; - push(@$keys, "no_index") if ($keys); + push(@$keys, "no_index"); } $node->{generated_by} = "Module::Build version $Module::Build::VERSION"; @@ -3147,12 +3150,12 @@ version => '1.2', url => 'http://module-build.sourceforge.net/META-spec-v1.2.html', }; - push(@$keys, "meta-spec") if ($keys); + push(@$keys, "meta-spec"); while (my($k, $v) = each %{$self->meta_add}) { $node->{$k} = $v; - push(@$keys, $k) if ($keys); + push(@$keys, $k); } while (my($k, $v) = each %{$self->meta_merge}) { |