ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/ToolDoc.pm
(Generate patch)

Comparing COMP/SCRAM/src/BuildSystem/ToolDoc.pm (file contents):
Revision 1.8 by sashby, Fri Nov 16 16:29:49 2001 UTC vs.
Revision 1.9 by sashby, Mon Nov 19 18:46:39 2001 UTC

# Line 275 | Line 275 | sub _askusermenu {
275  
276   sub _askuser
277     {
278 +   ###############################################################
279 +   # _askuser()                                                  #
280 +   ###############################################################
281 +   # modified : Mon Nov 19 15:51:01 2001 / SFA                   #
282 +   # params   :                                                  #
283 +   #          :                                                  #
284 +   #          :                                                  #
285 +   #          :                                                  #
286 +   # function : Looks for valid path to tool, either using a     #
287 +   #          : default path, or by using the lookup table.      #
288 +   #          :                                                  #
289 +   #          :                                                  #
290 +   ###############################################################
291     my $self=shift;
292 +  
293 +   # First, check for interactive flag. If "on", call the original
294 +   # version of this routine:
295 +   if ( $self->{interactive} )
296 +      {
297 +      my $ipath=$self->_askuseri(@_);
298 +      return $ipath;
299 +      }
300 +
301     my $querystring=shift;
302     my $varname=shift;
303     my $lookupdb = $main::lookupobject;
# Line 290 | Line 312 | sub _askuser
312     # Check if tool is listed in the lookupdb:
313     if ($lookupdb->checkTool(${$self->{tool}}{name}))
314        {
315 <      $self->verbose(">> Tool ",${$self->{tool}}{name}," exists in DB...");
315 >      $self->verbose(">> Tool ${$self->{tool}}{name} exists in DB...");
316        # Check if $varname is a tag that's listed in our lookup table for this tool:      
317        if ($lookupdb->lookupTag(${$self->{tool}}{name},$varname))
318            {
319 <          $self->verbose(">> Tag ",$varname," is defined for tool ",${$self->{tool}}{name});
319 >          $self->verbose(">> Tag $varname is defined for tool ${$self->{tool}}{name}");
320            # Get the value for this tag:
321            $path = $lookupdb->lookupTag(${$self->{tool}}{name},$varname);
322            }
# Line 337 | Line 359 | sub _askuser
359      return $path;
360     }
361  
362 +
363 + sub _askuseri
364 +   {
365 +   ###############################################################
366 +   # _askuseri()                                                 #
367 +   ###############################################################
368 +   # modified : Mon Nov 19 15:46:36 2001 / SFA                   #
369 +   # params   :                                                  #
370 +   #          :                                                  #
371 +   #          :                                                  #
372 +   #          :                                                  #
373 +   # function : Interactive version of askuser routine. Called   #
374 +   #          : when "-i" flag set in scramcli.                  #
375 +   #          :                                                  #
376 +   #          :                                                  #
377 +   ###############################################################
378 +   my $self = shift;
379 +   my $querystring = shift;
380 +   my $varname = shift;
381 +
382 +   my $type=$self->{tool}->type($varname);
383 +   my $path;
384 +   my $oldpath;
385 +
386 +   print $self->featuretext($self->{EnvContext});
387 +  
388 +   for  ( ;; )
389 +      {
390 +      print "\n".$querystring." (RETURN to log as missing)\nset $varname = ";
391 +      $path=<STDIN>;
392 +      chomp $path;
393 +      $oldpath=$path;
394 +
395 +      if ( $path ne "" )
396 +         {
397 +         ($path)=$self->_validateparam($type,$path);
398 +         if ( ! defined $path )
399 +            {
400 +            print "Error : ".$oldpath." is not valid.\n";
401 +            next;
402 +            }
403 +         }
404 +      return $path;
405 +      }
406 +   }
407 +
408 +
409   sub _validateparam {
410          my $self=shift;
411          my $type=shift;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines