From 2d46ee327ac3cb24a0e9ee6dc9c92cb38c9ec44a Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 20 Nov 2012 21:14:48 +0000 Subject: [PATCH] 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 --- xCAT-buildkit/bin/buildkit | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index 38ae8a342..20d829fb2 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -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)) {