From 573aba58d60c43799e95e684e6977184944247e2 Mon Sep 17 00:00:00 2001 From: ligc Date: Fri, 9 Jan 2015 15:10:06 +0800 Subject: [PATCH] fix for bug 4507: check the distribution name specified with copycds -n in debian.pm --- xCAT-server/lib/xcat/plugins/debian.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index dcaae3baf..0fc849329 100755 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -212,6 +212,14 @@ sub copycd #this plugin needs $path... return; } + if ( $distname + and $distname !~ /^debian/i + and $distname !~ /^ubuntu/i) + { + + #If they say to call it something unidentifiable, give up? + return; + } if ( $copypath || $noosimage || $nonoverwrite ){ $callback->({info=> ["copycd on debian/ubuntu doesn't support -p, -o, -w options!"]}); @@ -253,7 +261,9 @@ sub copycd # So that we have the netboot images $isnetinst = 1 if ($line2[7] eq "NETINST"); - $distname="debian".$ver; + if (!$distname) { + $distname="debian".$ver; + } $detdistname="debian".$ver; } elsif ($prod eq "Ubuntu" or $prod eq "Ubuntu-Server" ) @@ -261,7 +271,9 @@ sub copycd # to cover for LTS releases $darch = $line2[7] if ($line2[2] eq "LTS"); - $distname="ubuntu".$ver; + if (!$distname) { + $distname="ubuntu".$ver; + } $detdistname="ubuntu".$ver; $discno = `cat $path/README.diskdefines | grep 'DISKNUM ' | awk '{print \$3}'`; }