From 1d37352e856c9eada26ca25f648aff9bacdc5375 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 4 Apr 2013 13:03:50 +0000 Subject: [PATCH] Fix for template recognition to detect major release generic templates git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15825 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index a5514382d..ad1ff6bd4 100644 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -551,6 +551,8 @@ sub update_tables_with_templates if (($osver) && ($osver =~ /xCAT::SvrUtils/)) { $osver = shift; } + my $shortosver = $osver; + $shortosver =~ s/\..*//; my $arch = shift; #like ppc64, x86, x86_64 my $ospkgdir=shift; my $osdistroname=shift; @@ -608,9 +610,9 @@ sub update_tables_with_templates my $tmpf=basename($_); #get the profile name out of the file, TODO: this does not work if the profile name contains the '.' if ($tmpf =~ /[^\.]*\.([^\.]*)\.([^\.]*)\./) { # osver *and* arch specific, make sure they match - unless ($1 eq $osver and $2 eq $arch) { next; } + unless (($1 eq $osver or $1 eq $shortosver) and $2 eq $arch) { next; } } elsif ($tmpf =~ /[^\.]*\.([^\.]*)\./) { #osver *or* arch specific, make sure one matches - unless ($1 eq $osver or $2 eq $arch) { next; } + unless ($1 eq $osver or $1 eq $shortosver or $2 eq $arch) { next; } } $tmpf =~ /^([^\.]*)\..*$/; $tmpf = $1; @@ -622,9 +624,9 @@ sub update_tables_with_templates my $tmpf=basename($_); #get the profile name out of the file, TODO: this does not work if the profile name contains the '.' if ($tmpf =~ /[^\.]*\.([^\.]*)\.([^\.]*)\./) { # osver *and* arch specific, make sure they match - unless ($1 eq $osver and $2 eq $arch) { next; } + unless (($1 eq $osver or $1 eq $shortosver) and $2 eq $arch) { next; } } elsif ($tmpf =~ /[^\.]*\.([^\.]*)\./) { #osver *or* arch specific, make sure one matches - unless ($1 eq $osver or $2 eq $arch) { next; } + unless ($1 eq $osver or $1 eq $shortosver or $1 eq $arch) { next; } } $tmpf =~ /^([^\.]*)\..*$/; $tmpf = $1;