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

Comparing COMP/SCRAM/src/BuildSystem/TemplateInterface.pm (file contents):
Revision 1.3 by sashby, Tue Nov 14 17:43:14 2006 UTC vs.
Revision 1.4 by sashby, Mon Dec 4 14:21:23 2006 UTC

# Line 104 | Line 104 | sub template_object()
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     }
# Line 121 | Line 122 | sub template_config()
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     }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines