perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r20845 - trunk/lib/Parrot

Subject: [svn:parrot] r20845 - trunk/lib/Parrot
From:
Date: Sat, 25 Aug 2007 17:13:59 -0700 PDT
Newsgroups: perl.cvs.parrot

Author: jkeenan
Date: Sat Aug 25 17:13:58 2007
New Revision: 20845

Modified:
   trunk/lib/Parrot/Configure.pm

Log:
Commit in r20832 accidentally wiped out earlier revisions to
lib/Parrot/Configure.pm -- r20603 in particular.   Restore these, which adds a
'list_of_steps' and a 'hash_of_steps' elements to Parrot::Configure object.


Modified: trunk/lib/Parrot/Configure.pm
==============================================================================
--- trunk/lib/Parrot/Configure.pm       (original)
+++ trunk/lib/Parrot/Configure.pm       Sat Aug 25 17:13:58 2007
@@ -168,8 +168,11 @@
 sub add_steps {
     my ( $conf, @new_steps ) = @_;
 
-    foreach my $step (@new_steps) {
-        $conf->add_step($step);
+    $conf->{list_of_steps} = [ @new_steps ];
+
+    for (my $i = 0; $i <= $#new_steps; $i++) {
+        $conf->add_step($new_steps[$i]);
+        $conf->{hash_of_steps}->{$new_steps[$i]} = $i + 1;
     }
 
     return 1;
@@ -260,20 +263,28 @@
 
     # set per step verbosity
     if ( defined $args->{verbose_step} ) {
-
-        # by step number
         if (
-            $args->{verbose_step} =~ /^\d+$/
-            &&
-            $args->{n} == $args->{verbose_step}
+            (
+                # by step number
+                ( $args->{verbose_step} =~ /^\d+$/ )
+                    and
+                ( $args->{n} == $args->{verbose_step} )
+            )
+                or
+            (
+                # by step name
+                ( ${$conf->{hash_of_steps}}{$args->{verbose_step}} )
+                    and
+                ( $args->{verbose_step} eq $step_name )
+            )
+                or
+            (
+                # by description
+                $description =~ /$args->{verbose_step}/
+            )
         ) {
             $conf->options->set( verbose => 2 );
         }
-
-        # by description
-        elsif ( $description =~ /$args->{verbose_step}/ ) {
-            $conf->options->set( verbose => 2 );
-        }
     }
 
     # RT#43673 cc_build uses this verbose setting, why?
@@ -312,6 +323,8 @@
     print "..." if $args->{verbose} && $args->{verbose} == 2;
     print "." x ( 71 - length($description) - length($result) );
     print "$result." unless $step =~ m{^inter/} && $args->{ask};
+    # reset verbose value for the next step
+    $conf->options->set( verbose => $args->{verbose} );
 
     if ($conf->options->get(q{configure_trace}) ) {
         if (! defined $conftrace->[0]) {
@@ -325,8 +338,6 @@
         push @{$conftrace}, $evolved_data;
         nstore($conftrace, $sto);
     }
-    # reset verbose value for the next step
-    $conf->options->set( verbose => $args->{verbose} );
 }
 
 =item * C<option_or_data($arg)>
@@ -356,6 +367,7 @@
     return defined $opt ? $opt : $conf->data->get( $arg );
 }
 
+
 =back
 
 =head1 CREDITS

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r20845 - trunk/lib/Parrot, jkeenan <=