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

Comparing COMP/SCRAM/src/BuildSystem/ToolManager.pm (file contents):
Revision 1.24 by muzaffar, Tue Jun 12 15:54:23 2012 UTC vs.
Revision 1.26 by muzaffar, Wed Feb 13 11:44:13 2013 UTC

# Line 30 | Line 30 | sub new
30     return $self;
31     }
32  
33 + sub initpathvars()
34 +   {
35 +   my $self=shift;
36 +   if (!exists $self->{internal}{path_variables})
37 +      {
38 +      my %pathvars=("PATH", 1, "LD_LIBRARY_PATH", 1, "DYLD_LIBRARY_PATH", 1, "DYLD_FALLBACK_LIBRARY_PATH", 1, "PYTHONPATH", 1);
39 +      my $p = $self->_parsetool($self->{configdir}."/Self.xml");
40 +      if ((exists $p->{content}) && (exists $p->{content}{CLIENT}) && (exists $p->{content}{CLIENT}{FLAGS}))
41 +         {
42 +         if (exists $p->{content}{CLIENT}{FLAGS}{REM_PATH_VARIABLES})
43 +            {
44 +            foreach my $f (@{$p->{content}{CLIENT}{FLAGS}{REM_PATH_VARIABLES}})
45 +               {
46 +               delete $pathvars{$f};
47 +               }
48 +            }
49 +         if (exists $p->{content}{CLIENT}{FLAGS}{PATH_VARIABLES})
50 +            {
51 +            foreach my $f (@{$p->{content}{CLIENT}{FLAGS}{PATH_VARIABLES}})
52 +               {
53 +               $pathvars{$f}=1;
54 +               }
55 +            }
56 +         }
57 +      my $paths = join("|",keys %pathvars);
58 +      if ($paths){$paths = "^($paths)\$";}
59 +      $self->{internal}{path_variables}=$paths;
60 +      }
61 +   }
62 +
63   sub init ()
64     {
65     my $self=shift;
# Line 39 | Line 69 | sub init ()
69     $self->{archstore}=$projectarea->archdir();
70     $self->{toolcache}=$self->{configdir}."/toolbox/$ENV{SCRAM_ARCH}/tools";
71     $self->name($projectarea->toolcachename());
72 +   $self->initpathvars();
73     $self->dirty();
74     }
75    
# Line 60 | Line 91 | sub coresetup()
91     my $self=shift;
92     my ($toolfile) = @_;
93    
94 <   my $toolparser = BuildSystem::ToolParser->new();
95 <   $toolparser->filehead('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><doc type="BuildSystem::ToolDoc" version="1.0">');
65 <   $toolparser->filetail('</doc>');
66 <   $toolparser->parse($toolfile);
94 >   my $toolparser = $self->_parsetool($toolfile);
95 >   my $store = $toolparser->processrawtool();
96     my $toolname = $toolparser->toolname();
97     my $toolversion = $toolparser->toolversion();
98     scramlogmsg("\n",$::bold."Setting up ",$toolname," version ",$toolversion,":  ".$::normal,"\n");
70  
71   # Next, set up the tool:
72   my $store = $toolparser->processrawtool();
99  
100     # Store the ToolData object in the cache:  
101     $self->storeincache($toolname,$store);
# Line 102 | Line 128 | sub setupself()
128        {
129        scramlogmsg("\n",$::bold."Setting up SELF:".$::normal,"\n");
130        # Self file exists so process it:
131 <      $selfparser = BuildSystem::ToolParser->new();
132 <      $selfparser->filehead ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><doc type="BuildSystem::ToolDoc" version="1.0">');
107 <      $selfparser->filehead ('</doc>');
108 <      $selfparser->parse($filename);
109 <
110 <      # Next, set up the tool:
111 <      $store = $selfparser->processrawtool();
112 <
131 >      my $selfparser = $self->_parsetool($filename);
132 >      my $store = $selfparser->processrawtool();
133        # If we are in a developer area, also add RELEASETOP paths:
134        if (exists($ENV{RELEASETOP}))
135           {
# Line 206 | Line 226 | sub toolsdata()
226     return $data;
227     }
228  
229 + sub _parsetool()
230 +   {
231 +   my ($self,$filename)=@_;
232 +   my $p = BuildSystem::ToolParser->new($self->{internal}{path_variables});
233 +   $p->filehead ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><doc type="BuildSystem::ToolDoc" version="1.0">');
234 +   $p->filetail ('</doc>');
235 +   $p->parse($filename);
236 +   return $p;
237 +   }
238 +
239   sub _toolsdata()
240     {
241     my $self = shift;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines