support copycds -i on debian/ubuntu

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15595 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2013-03-20 08:08:50 +00:00
parent bab48dbc50
commit 5777cd4dd7

View File

@ -189,7 +189,11 @@ sub copycd
GetOptions(
'n=s' => \$distname,
'a=s' => \$arch,
'p=s' => \$copypath,
'm=s' => \$path,
'i' => \$inspection,
'o' => \$noosimage,
'w' => \$nonoverwrite,
);
unless ($path)
{
@ -197,6 +201,11 @@ sub copycd
#this plugin needs $path...
return;
}
if ( $copypath || $noosimage || $nonoverwrite ){
$callback->({info=> ["copycd on debian/ubuntu doesn't support -p, -o, -w options!"]});
return;
}
unless (-r $path . "/.disk/info")
{
@ -210,6 +219,13 @@ sub copycd
my @line2 = split(/ /,$line);
close($dinfo);
#read the cd_type for the inspection
my $cdtype;
open($dinfo, $path . "/.disk/cd_type");
$cdtype = <$dinfo>;
chomp($line);
close($dinfo);
my $isnetinst = 0;
my $prod = $line2[0]; # The product should be the first word
my $ver = $line2[1]; # The version should be the second word
@ -269,7 +285,7 @@ sub copycd
{
$arch = $darch;
}
if ($arch and $arch ne $darch)
if ($arch and ($arch ne $darch) and ($arch ne $debarch))
{
$callback->(
{
@ -281,6 +297,15 @@ sub copycd
return;
}
}
if ( $inspection ){
$callback->(
{
info =>
"DISTNAME:$distname\n"."ARCH:$debarch\n"."DISCTYPE:$cdtype\n"
}
);
return;
}
%{$request} = (); #clear request we've got it.
$callback->(