fix defect 3847 buildkit addpkgs -k -r left useless kit component rpm in complete kit repos dir
This commit is contained in:
parent
1c379b1590
commit
dff4cad29f
@ -3892,6 +3892,47 @@ sub NEW_kit_addpkgs
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#When using -k -r, there are useless repodir
|
||||
#delete useless repo dir
|
||||
my $kitrepodirby=$::base_repodir;
|
||||
my $cmdby = "/bin/ls $kitrepodirby 2>/dev/null";
|
||||
my $outputby = `$cmdby`;
|
||||
my @allrepolist = split(/\n/, $outputby);
|
||||
my @dellist;
|
||||
|
||||
foreach my $reponame (@allrepolist)
|
||||
{
|
||||
my $match=0;
|
||||
foreach my $kr (@{$::bldkit_config->{kitrepo}{entries}})
|
||||
{
|
||||
my $repodirname = "$kr->{kitreponame}";
|
||||
|
||||
if ( ${repodirname} eq ${reponame} )
|
||||
{
|
||||
${match}++;
|
||||
}
|
||||
}
|
||||
if ( ${match} == 0 )
|
||||
{
|
||||
push(@dellist,$reponame);
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $del (@dellist)
|
||||
{
|
||||
my $delrepodir=$::base_repodir."/".$del ;
|
||||
if ( -d $delrepodir )
|
||||
{
|
||||
my $delcmd="rm -Rf $delrepodir";
|
||||
if ( system($delcmd) )
|
||||
{
|
||||
print "Failed to delete useless repo directory \n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Build the full kit tar file
|
||||
my $buildtar_rc = &kit_buildtar;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user