From 014b82f976f95d92eca1cd6a778c401189cf6d50 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 19 Jun 2014 12:52:07 -0400 Subject: [PATCH] fix the issue that cannot handle the case that XX in #INCLUDE:XX# also replacable --- xCAT-server/lib/perl/xCAT/Template.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index f77c5f06d..523644b04 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -178,19 +178,21 @@ sub subvars { while (not $doneincludes) { $doneincludes=1; $inc =~ s/#ENV:([^#]+)#/envvar($1)/eg; # handle the variable in #INCLUDE - if ($inc =~ /#INCLUDE_PKGLIST:[^#^\n]+#/) { + if ($inc =~ /#INCLUDE_PKGLIST:[^\n]+#/) { + # get in this section but might not do the replace since it needs wait + # for the replace of sting inside the #INCLUDE_PKGLIST:xx# $doneincludes=0; $inc =~ s/#INCLUDE_PKGLIST:([^#^\n]+)#/includefile($1, 0, 1)/eg; } - if ($inc =~ /#INCLUDE_PTRNLIST:[^#^\n]+#/) { + if ($inc =~ /#INCLUDE_PTRNLIST:[^\n]+#/) { $doneincludes=0; $inc =~ s/#INCLUDE_PTRNLIST:([^#^\n]+)#/includefile($1, 0, 2)/eg; } - if ($inc =~ /#INCLUDE_RMPKGLIST:[^#^\n]+#/) { + if ($inc =~ /#INCLUDE_RMPKGLIST:[^\n]+#/) { $doneincludes=0; $inc =~ s/#INCLUDE_RMPKGLIST:([^#^\n]+)#/includefile($1, 0, 3)/eg; } - if ($inc =~ /#INCLUDE:[^#^\n]+#/) { + if ($inc =~ /#INCLUDE:[^\n]+#/) { $doneincludes=0; $inc =~ s/#INCLUDE:([^#^\n]+)#/includefile($1, 0, 0)/eg; }