From 8f90acc07cb7e5715b49606f34a944931f23d736 Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 10 Mar 2015 14:49:54 -0400 Subject: [PATCH] defect 4349: fix rmkitcomp othepkgs dir removal; fix typo in Schema.pm to now display kitcomponent reponame correctly --- perl-xCAT/xCAT/Schema.pm | 2 +- xCAT-server/lib/xcat/plugins/kit.pm | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index f9574c00a..c1deed358 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -3710,7 +3710,7 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs); access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname', }, {attr_name => 'kitreponame', - tabentry => 'kitcomponent.kitrepoid', + tabentry => 'kitcomponent.kitreponame', access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname', }, {attr_name => 'basename', diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 1c50f3b5b..ac1393f31 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -2737,7 +2737,7 @@ sub rmkitcomp # Read all the kitcomponents assigned to all the osimage to make sure the repo used by other osimage # will not be deleted. - my @allosikitcomps = $tabs{osimage}->getAllAttribs( 'imagename', 'kitcomponents' ); + my @allosikitcomps = $tabs{osimage}->getAllAttribs( 'imagename', 'kitcomponents','otherpkgdir' ); (my $linuximagetable) = $tabs{linuximage}->getAttribs({imagename=> $osimage}, 'postinstall', 'exlist', 'otherpkglist', 'otherpkgdir', 'driverupdatesrc'); if ( $linuximagetable and $linuximagetable->{otherpkgdir} ) { @@ -2750,7 +2750,11 @@ sub rmkitcomp if ( $allosikitcomp->{kitcomponents} and $allosikitcomp->{imagename} ) { my @allkitcomps = split /,/, $allosikitcomp->{kitcomponents}; foreach my $allkitcomp ( @allkitcomps ) { - if ( $allosikitcomp->{imagename} ne $osimage or $allkitcomp ne $kitcomponent ) { + if ( (($allosikitcomp->{imagename} ne $osimage) and + ( $allosikitcomp->{otherpkgdir} eq $otherpkgdir )) + or ($allkitcomp ne $kitcomponent) ) { + +} $newosikitcomponents{$allkitcomp} = 1; } }