150 |
|
{ |
151 |
|
use Cache::CacheUtilities; |
152 |
|
my $satoolmanager=&Cache::CacheUtilities::read($sa->toolcachename()); |
153 |
< |
# Copy needed content from toolmanager for scram-managed project: |
154 |
< |
$self->inheritcontent($satoolmanager); |
153 |
> |
# Copy needed content from toolmanager for scram-managed project only |
154 |
> |
# if the projects have compatible configurations (compare first set of |
155 |
> |
# digits): |
156 |
> |
if ($self->check_compatibility($satoolmanager)) |
157 |
> |
{ |
158 |
> |
print "DEBUG: $pname and current project have compatible configurations.\n"; |
159 |
> |
$self->inheritcontent($satoolmanager); |
160 |
> |
} |
161 |
> |
else |
162 |
> |
{ |
163 |
> |
print "DEBUG: $pname and current project do NOT have compatible configurations. Skipping...\n"; |
164 |
> |
} |
165 |
|
} |
166 |
|
} |
167 |
|
} |
631 |
|
} |
632 |
|
} |
633 |
|
|
634 |
+ |
sub check_compatibility() |
635 |
+ |
{ |
636 |
+ |
my $self=shift; |
637 |
+ |
my ($itoolmgr)=@_; |
638 |
+ |
# Get the version of the toolmanager. If the project fails to return a version |
639 |
+ |
# string we return 0 for no compatibility (in which case, all tools will be set |
640 |
+ |
# up in the traditional way): |
641 |
+ |
my $itm_configversion = $itoolmgr->configversion(); |
642 |
+ |
if ($itm_configversion) |
643 |
+ |
{ |
644 |
+ |
# The configurations won't be identical. We must compare the digits: |
645 |
+ |
my ($numeric_version) = ($itm_configversion =~ /[a-zA-Z]*\_([0-9a-z]*).*?/); |
646 |
+ |
my $current_configversion = $self->configversion(); |
647 |
+ |
my ($current_numeric_version) = ($current_configversion =~ /[a-zA-Z]*\_([0-9a-z]*).*?/); |
648 |
+ |
($current_numeric_version == $numeric_version) && return 1; # OK, compatible; |
649 |
+ |
} |
650 |
+ |
# Project does not define configuration version so just return: |
651 |
+ |
return 0; |
652 |
+ |
} |
653 |
+ |
|
654 |
+ |
sub configversion() |
655 |
+ |
{ |
656 |
+ |
my $self=shift; |
657 |
+ |
@_ ? $self->{CONFIGVERSION} = shift |
658 |
+ |
: $self->{CONFIGVERSION}; |
659 |
+ |
} |
660 |
+ |
|
661 |
|
1; |