buildkit addpkgs - rewrite kit.conf file

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14375 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
mellor 2012-11-20 21:14:48 +00:00
parent 3ae78546d7
commit 2d46ee327a

View File

@ -2156,9 +2156,13 @@ sub kit_addpkgs
my $ext_reponames = '';
my $attr;
my %create_repodata_list;
my @new_lines;
foreach my $l (@lines) {
# skip blank and comment lines
next if ( $l =~ /^\s*$/ || $l =~ /^\s*#/ );
if ( $l =~ /^\s*$/ || $l =~ /^\s*#/ ) {
push(@new_lines, $l);
next;
}
if ( $l =~ /^\s*EXTERNALPKG:/ ) {
$extpkg_section = 1;
$ext_filename = '';
@ -2210,10 +2214,22 @@ sub kit_addpkgs
}
} else {
$extpkg_section = 0;
push(@new_lines, $l);
next;
}
} else {
push(@new_lines, $l);
}
}
# Re-write kit.conf with EXTERNALPKG sections removed
my $NCF;
unless ( open( $NCF, ">$tmp_kit_conf" ) ) {
return 1;
}
print $NCF @new_lines;
close($NCF);
# Run createrepo for each updated directory
foreach my $repo (keys(%create_repodata_list)) {