From bba164615f3d493a3c2e5ba1fa69c583849cbb68 Mon Sep 17 00:00:00 2001 From: mellor Date: Mon, 10 Dec 2012 21:26:39 +0000 Subject: [PATCH] allow same kitcomponent basenames git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14609 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-buildkit/bin/buildkit | 21 +++++++++++++++---- .../xcat/kits/kit_template/buildkit.conf | 7 +++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index 20d829fb2..f55ec5ddb 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -655,7 +655,7 @@ sub kit_buildrepo1 if (-r $rpm) { next; } # Build it - if ($::VERBOSE) { print "building kitcomponet metapackage for $kc->{basename} \n";} + if ($::VERBOSE) { print "building kitcomponent metapackage for $kc->{basename} \n";} if (&build_kitcomp($kc)) { print "Error building kitcomponent metapackage for $kc->{basename} \n"; return 1; @@ -1131,15 +1131,28 @@ sub validate_bldkitconf } } - # Make sure each kitcomponent has unique basename + # Make sure each kitcomponent has unique basename/repoid + # If same basename, make sure version/release are same, too my $kc_count = scalar @{$::bldkit_config->{kitcomponent}{entries}}; if ($kc_count > 1) { foreach my $kci (0..$kc_count-2) { foreach my $kci2 ($kci+1..$kc_count-1) { if ( $::bldkit_config->{kitcomponent}{entries}[$kci]->{basename} eq $::bldkit_config->{kitcomponent}{entries}[$kci2]->{basename} ) { - print "There are two or more kitcomponent sections which are defined with the same basename \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{basename}\". \n"; - return 1; + if ( $::bldkit_config->{kitcomponent}{entries}[$kci]->{kitrepoid} + eq $::bldkit_config->{kitcomponent}{entries}[$kci2]->{kitrepoid} ) { + + print "Two or more kitcomponents are defined with the same basename \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{basename}\" and the same repoid \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{kitrepoid}\". \n"; + return 1; + } + if ( ($::bldkit_config->{kitcomponent}{entries}[$kci]->{version} + ne $::bldkit_config->{kitcomponent}{entries}[$kci2]->{version}) || + ($::bldkit_config->{kitcomponent}{entries}[$kci]->{release} + ne $::bldkit_config->{kitcomponent}{entries}[$kci2]->{release}) + ) { + print "Two or more kitcomponents are defined with the same basename \"$::bldkit_config->{kitcomponent}{entries}[$kci]->{basename}\" but with different version or release. \n"; + return 1; + } } } } diff --git a/xCAT-buildkit/share/xcat/kits/kit_template/buildkit.conf b/xCAT-buildkit/share/xcat/kits/kit_template/buildkit.conf index 6d61e9d51..785221b33 100644 --- a/xCAT-buildkit/share/xcat/kits/kit_template/buildkit.conf +++ b/xCAT-buildkit/share/xcat/kits/kit_template/buildkit.conf @@ -60,6 +60,13 @@ kitrepo: # you should create one kitcomponent section for each OS. # Also, no two components in a kit can be defined with the same # base name. +# You can define multiple kit components with the same base name +# only if each kit component using this base name meets these +# requirements: +# - Each kit component must be defined with the same version +# and release number +# - Each kit component must be defined with a unique kitrepoid + # # kitcomponent attributes: # basename (mandatory) Kit component base name