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; |
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 |
|
|
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); |
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 |
|
{ |
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; |