From 8e85a8640cb9b1651acf5f558b0c04b447c2bcc8 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 25 May 2010 15:29:28 +0000 Subject: [PATCH] -Change version detection semantics to pick up sles11.1 correctly git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6219 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/sles.pm | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 6488462aa..38f160543 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -868,10 +868,24 @@ sub copycd if ($prod =~ m/SUSE-Linux-Enterprise-Server/) { - my @parts = split /\s+/, $prod; - my @subparts = split /-/, $parts[2]; - $detdistname = "sles" . $subparts[0]; - unless ($distname) { $distname = "sles" . $subparts[0] }; + if (-f "$path/content") { + my $content; + open($content,"<","$path/content"); + my @contents = <$content>; + close($content); + foreach (@contents) { + if (/^VERSION/) { + my @verpair = split; + $detdistname = "sles".$verpair[1]; + unless ($distname) { $distname = $detdistname; } + } + } + } else { + my @parts = split /\s+/, $prod; + my @subparts = split /-/, $parts[2]; + $detdistname = "sles" . $subparts[0]; + unless ($distname) { $distname = "sles" . $subparts[0] }; + } # check media.1/products for text. # the cselx is a special GE built version. # openSUSE is the normal one.