From ea3431f5a79cc626cf4ce3c78cd0c834c4e1356c Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 2 Apr 2013 19:54:24 +0000 Subject: [PATCH] defect 3385 again - need separate subs for both real kitname and modified kitname git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15795 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-buildkit/bin/buildkit | 6 ++++-- .../plugins/sample/imageprofile.pm | 18 +++++++++--------- .../kit_template/plugins/sample/nodemgmt.pm | 10 +++++----- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index c574d7c37..c10238649 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -2840,8 +2840,9 @@ sub edit_plugin my $kitname = $::bldkit_config->{kit}{entries}[0]->{kitname}; # convert dashes to underscore since the kitname is used as perl pkg names # in the plugin and this causes perl syntax errors - $kitname =~ s/\-/\_/g; - $kitname =~ s/\./\_/g; + my $mod_kitname = $kitname; + $mod_kitname =~ s/\-/\_/g; + $mod_kitname =~ s/\./\_/g; # read in the file my $PF; @@ -2854,6 +2855,7 @@ sub edit_plugin for (@lines) { s/<<>>/$kitname/g; + s/<<>>/$mod_kitname/g; } # Write the plugin back out diff --git a/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm b/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm index b2769798b..87307b132 100644 --- a/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm +++ b/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm @@ -3,7 +3,7 @@ #TEST: UNCOMMENT the first line, and COMMENT OUT the second line. #BUILD: COMMENT OUT the first line, and UNCOMMENT the second line. #package xCAT_plugin::imageprofile; -package xCAT_plugin::<<>>_imageprofile; +package xCAT_plugin::<<>>_imageprofile; use strict; use warnings; @@ -128,14 +128,14 @@ sub handled_commands { # kitimagepostdelete => 'imageprofile', #}; return { - kitimagepregenerate => '<<>>_imageprofile', - kitimagepostgenerate => '<<>>_imageprofile', - kitimageprecopy => '<<>>_imageprofile', - kitimagepostcopy => '<<>>_imageprofile', - kitimagepreupdate => '<<>>_imageprofile', - kitimagepostupdate => '<<>>_imageprofile', - kitimagepredelete => '<<>>_imageprofile', - kitimagepostdelete => '<<>>_imageprofile', + kitimagepregenerate => '<<>>_imageprofile', + kitimagepostgenerate => '<<>>_imageprofile', + kitimageprecopy => '<<>>_imageprofile', + kitimagepostcopy => '<<>>_imageprofile', + kitimagepreupdate => '<<>>_imageprofile', + kitimagepostupdate => '<<>>_imageprofile', + kitimagepredelete => '<<>>_imageprofile', + kitimagepostdelete => '<<>>_imageprofile', }; } diff --git a/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/nodemgmt.pm b/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/nodemgmt.pm index f8d03f69b..e8392efe4 100644 --- a/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/nodemgmt.pm +++ b/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/nodemgmt.pm @@ -3,7 +3,7 @@ #TEST: UNCOMMENT the first line, and COMMENT OUT the second line. #BUILD: COMMENT OUT the first line, and UNCOMMENT the second line. #package xCAT_plugin::nodemgmt; -package xCAT_plugin::<<>>_nodemgmt; +package xCAT_plugin::<<>>_nodemgmt; use strict; use warnings; @@ -113,10 +113,10 @@ sub handled_commands { # kitnoderefresh => 'nodemgmt', #}; return { - kitnodeadd => '<<>>_nodemgmt', - kitnoderemove => '<<>>_nodemgmt', - kitnodeupdate => '<<>>_nodemgmt', - kitnoderefresh => '<<>>_nodemgmt', + kitnodeadd => '<<>>_nodemgmt', + kitnoderemove => '<<>>_nodemgmt', + kitnodeupdate => '<<>>_nodemgmt', + kitnoderefresh => '<<>>_nodemgmt', }; }