From ed0087a9695fcfc193fa9d14bfca80cba2c358ff Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Thu, 10 Jan 2013 08:07:06 +0000 Subject: [PATCH] Fixing two problems: 1. create tmp rpm spec file to different kit repo and kit component basename. Previously the tmp spec file is named with kitcomponent basename. if there are two kitcomponents in two kitrepo with same basename, the tmp rpm spec file will be overwrite. 2. the kitpkgdeps version information should be removed while writing to kit conf and later writing to xCAT DB, since kitpkgdeps is only used while they are being removed, we dont need the version info. So we don't need to keep the version info which make the kitcomponent table quite big and not easy to read. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14842 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-buildkit/bin/buildkit | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index 989f16e4b..395f06833 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -1673,7 +1673,7 @@ sub build_kitcomp $avoiderr .= "-$comp->{version}-$comp->{release}.$repo{osarch}"; mkpath($avoiderr); - my $specfile = $::workdir."/tmp/$comp->{basename}.spec"; + my $specfile = $::workdir."/tmp/$comp->{kitrepoid}-$comp->{basename}.spec"; my $rpmbuild_cmd = "rpmbuild --define \"_topdir $rpmbuild_dir\" -ba $specfile"; # Copy in any non-native packages @@ -1805,7 +1805,7 @@ sub gen_kitcomp_spec @lines = split(/\\n/,$joined_lines); mkpath($tmpdir); my $NSF; - unless ( open( $NSF, ">$tmpdir/$comp->{basename}.spec" ) ) { + unless ( open( $NSF, ">$tmpdir/$comp->{kitrepoid}-$comp->{basename}.spec" ) ) { return 1; } if ($::VERBOSE) { @@ -1877,7 +1877,19 @@ sub create_kitconf foreach my $a (keys %{$::buildkit_def{$s}}) { if (( $::buildkit_def{$s}{$a}->{cp_to_kitconfig} eq '1' ) && ( defined ($se->{$a}) ) ) { - $::kit_config->{$s}{entries}[$li]->{$a} = $se->{$a} + if ( $s eq 'kitcomponent' ) { + if ($a eq 'kitpkgdeps') { + my $value; + foreach my $d (split(/,/, $se->{$a})) { + $d =~ s/\s+//g; + $d =~ s/^([\w\.\-]+)[<>=]*.*$/$1/; + $value .= "$d,"; + } + $value =~ s/,$//; + $se->{$a} = $value; + } + } + $::kit_config->{$s}{entries}[$li]->{$a} = $se->{$a}; } if (( $::buildkit_def{$s}{$a}->{cp_to_kitconfig} eq '2' ) && ( defined ($se->{$a}) ) ) {