@@ -30,8 +30,6 @@ use Rex::TaskList;
30
30
use Rex::Logger;
31
31
use YAML;
32
32
33
- use Data::Dumper;
34
-
35
33
my $no_color = 0;
36
34
eval " use Term::ANSIColor" ;
37
35
if ($@ ) { $no_color = 1; }
@@ -197,6 +195,7 @@ FORCE_SERVER: {
197
195
198
196
load_server_ini_file($: :rexfile);
199
197
load_rexfile($: :rexfile);
198
+ check_template_modules();
200
199
201
200
# ### check if some parameters should be overwritten from the command line
202
201
CHECK_OVERWRITE: {
@@ -455,6 +454,30 @@ sub __help__ {
455
454
456
455
}
457
456
457
+ # Check whether Rex/Template.pm
458
+ # or Rex/Template/NG.pm modules are loaded. If there are,
459
+ # they should be present in the %INC hash.
460
+ sub check_template_modules {
461
+ my @tpl_modules_loaded =
462
+ grep { / (Rex\/ Template|Rex\/ Template\/ NG)/ } keys %INC ;
463
+ if ( scalar @tpl_modules_loaded > 0 ) {
464
+ Rex::Logger::info(
465
+ " WARNING! You are using Rex built-in template engine aka Rex::Template." ,
466
+ " warn"
467
+ );
468
+ Rex::Logger::info(
469
+ " This engine is obsolete, unmaintained and will be retired in future releases." ,
470
+ " warn"
471
+ );
472
+ Rex::Logger::info(
473
+ " Please consider migrating to a more modern template engine." , " warn" );
474
+ Rex::Logger::info(
475
+ " Text::Template::Simple, Template::Toolkit, etc. As usual, CPAN is you friend." ,
476
+ " warn"
477
+ );
478
+ }
479
+ }
480
+
458
481
sub add_help {
459
482
my ( $self , $code ) = @_ ;
460
483
push ( @help , $code );
0 commit comments