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; } }