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.6 by sashby, Fri Oct 19 18:14:23 2001 UTC vs.
Revision 1.7 by sashby, Thu Nov 15 21:18:16 2001 UTC

# Line 137 | Line 137 | sub setup {
137          $self->verbose("Setup Parse");
138          $self->{switch}->parse("setup");
139          undef $self->{toolmakefilefh};
140 +
141          return $self->{toolfound};
142   }
143  
# Line 167 | Line 168 | sub _checkdefault {
168          return 0;
169   }
170  
171 < sub _testlocation {
172 <        my $self=shift;
173 <        my $default=shift;
174 <        my $testfiles=shift;
175 <
176 <        my $OK='false';
177 <        my $file;
178 <
179 <        chomp $default;
180 <        $default=$self->_expandvars($default);
181 <        $self->verbose("Testing location");
182 <        print "Trying $default .... ";
183 <        if ( -f $default ) {
184 <                $OK="true";
185 <                $self->verbose("File OK");
186 <        }
187 <        else {
188 <          my $dh=DirHandle->new();
189 <          opendir $dh, $default or do { print "No $!\n"; return 0; };
190 <         ($#{$testfiles}==-1) ? $OK='false' : $OK='true';
191 <          print "\n";
192 <          my @files=readdir $dh;
193 <          undef $dh;
194 <          foreach $file ( @$testfiles ) {
195 <                print "   Checking for $file .... ";
196 <                # now check that the required files are actually there
197 <                if ( ( $number = grep /\Q$file\L/, @files) == 0 ) {
198 <                   $OK='false';
199 <                   print "not found\n";
200 <                   last;
201 <                }
202 <                print "found\n";
203 <          }
204 <        }
205 <        if ( $OK eq 'true' ) {
206 <                print "Existence Check Complete\n";
207 <                return 1
208 <        }
209 <        return 0
210 < }
171 > sub _testlocation
172 >   {
173 >   my $self=shift;
174 >   my $default=shift;
175 >   my $testfiles=shift;
176 >   my $OK='false';
177 >   my $file;
178 >  
179 >   chomp $default;
180 >   $default=$self->_expandvars($default);
181 >   $self->verbose("Testing location");
182 >  
183 >   if ( -f $default )
184 >      {
185 >      $OK="true";
186 >      $self->verbose("File OK");
187 >      }
188 >   else
189 >      {
190 >      my $dh=DirHandle->new();
191 >      
192 >      opendir $dh, $default or do
193 >         {
194 >         printf ("\nTrying %-s ...... >>%s<<\n",$default,$!,);
195 >         return 0;
196 >         };
197 >      
198 >      ($#{$testfiles}==-1) ? $OK='false' : $OK='true';
199 >      #print "\n";
200 >      my @files=readdir $dh;
201 >      undef $dh;
202 >
203 >      foreach $file ( @$testfiles )
204 >         {
205 >         # now check that the required files are actually there
206 >         if ( ( $number = grep /\Q$file\L/, @files) == 0 )
207 >            {
208 >            $OK='false';
209 >            $status = "[not found]";
210 >            last;
211 >            }
212 >         $status = "[OK]";
213 >         printf ("\t\tChecking for %-22s............ %-s\n",$file,$status);
214 >         }
215 >      print "\n";
216 >      }
217 >  
218 >   if ( $OK eq 'true' )
219 >      {
220 >      printf ("Existence check for %-30s ............ [OK]\n",$default.":");
221 >      return 1;
222 >      }
223 >  
224 >   return 0;
225 >   }
226  
227   sub _expandvars {
228          my $self=shift;
# Line 572 | Line 588 | sub Environment_Start {
588               }
589             }
590             if ( $#menulist >=0 ) {
591 <            print "Validating Values for Variable : ".$$hashref{'name'}."\n";
591 >            print "Validating Values for Variable: ".$$hashref{'name'}."\n";
592              @menulist=$self->_validateparam($$hashref{'type'},@menulist);
593             }
594 +           print "\n";
595             # -- If theres only one option take it without asking
596 <           if ( $#menulist == 0 && ( ! $self->interactive() )) {
597 <                $val=$menulist[0];
598 <           }
596 >           if ( $#menulist == 0 && ( ! $self->interactive() ))
597 >              {
598 >              print "VALUE: ",$val,"\n";
599 >              $val=$menulist[0];
600 >              }
601             elsif ( $#menulist > 0 ) {
602                my $in=$self->_askusermenu(
603                  "Multiple possibilities found for ".
604 <                $$hashref{'name'}." ( occurance ".
604 >                $$hashref{'name'}." ( occurrance ".
605                  ($self->{EnvironmentCount}{$$hashref{'name'}}+1)." ) ".
606                  "\nPlease Choose: ",
607                  (@menulist,"Other"));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines