104 |
|
sub template_dir() |
105 |
|
{ |
106 |
|
my $self=shift; |
107 |
< |
# Default template dir: |
108 |
< |
my $templatedir = $ENV{LOCALTOP}."/".$ENV{SCRAM_CONFIGDIR}; |
109 |
< |
# Allow projects to override the template dir (subdir of config): |
110 |
< |
if (exists ($ENV{SCRAM_PROJECT_TEMPLATEDIR})) { |
111 |
< |
$templatedir.="/".$ENV{SCRAM_PROJECT_TEMPLATEDIR}; |
107 |
> |
my ($templatedir)=@_; |
108 |
> |
my $dir = $ENV{LOCALTOP}."/".$ENV{SCRAM_CONFIGDIR}; |
109 |
> |
if ((exists $ENV{SCRAM_PROJECT_TEMPLATEDIR}) && |
110 |
> |
($ENV{SCRAM_PROJECT_TEMPLATEDIR} !~ /^\s*$/)) { |
111 |
> |
$dir = $ENV{SCRAM_PROJECT_TEMPLATEDIR}; |
112 |
|
} |
113 |
+ |
$templatedir ||= $dir; |
114 |
|
$self->{TEMPLATE_DIR} = $templatedir; |
115 |
|
return $self; |
116 |
|
} |
122 |
|
$self->{TEMPLATE_CONFIG} = |
123 |
|
{ |
124 |
|
INCLUDE_PATH => [ "$self->{TEMPLATE_DIR}","$ENV{LOCALTOP}/$ENV{SCRAM_CONFIGDIR}" ], |
125 |
< |
PLUGIN_BASE => [ qw(SCRAM::Plugins BuildSystem::Template::Plugins) ], |
126 |
< |
EVAL_PERL => 1 |
127 |
< |
}; |
125 |
> |
PLUGIN_BASE => [ qw(SCRAM::Plugins BuildSystem::Template::Plugins) ], |
126 |
> |
EVAL_PERL => 1, |
127 |
> |
ABSOLUTE => 1 |
128 |
> |
}; |
129 |
|
|
130 |
|
return $self; |
131 |
|
} |