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
This commit is contained in:
wanghuaz 2013-01-10 08:07:06 +00:00
parent 01815332da
commit ed0087a969

View File

@ -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}) ) ) {