Support 'specific' copycds mode.

ESXi releases updates without bumping version numbers.  For such cases,
the default behavior is for the new version to supersede the old.  This
makes sense for the vast majority of cases.  There are, however, corner
cases where being explicit about the release is indicated.
This commit is contained in:
Jarrod Johnson 2014-03-21 10:56:20 -04:00
parent d33000aef6
commit fe38638b4b
2 changed files with 37 additions and 1 deletions

View File

@ -43,6 +43,7 @@ sub process_request {
my $path=undef;
my $noosimage=undef;
my $nonoverwrite=undef;
my $specific=undef;
$identified=0;
$::CDMOUNTPATH="/var/run/xcat/mountpoint";
@ -58,6 +59,7 @@ sub process_request {
'i|inspection' => \$inspection,
'p|path=s' => \$path,
'o|noosimage' => \$noosimage,
's|specific' => \$specific,
'w|nonoverwrite' => \$nonoverwrite,
);
if ($help) {
@ -143,6 +145,10 @@ sub process_request {
{
push @{$newreq->{arg}},("-p",$path);
}
if($specific)
{
push @{$newreq->{arg}},("-s");
}
if($inspection)
{

View File

@ -4141,10 +4141,12 @@ sub copycd {
}
#}
@ARGV = @{$request->{arg}};
my $includeupdate = 0;
GetOptions(
'n=s' => \$distname,
'a=s' => \$arch,
'm=s' => \$path
'm=s' => \$path,
's' => \$includeupdate
);
# run a few tests to see if the copycds should use this plugin
unless ($path){
@ -4236,6 +4238,34 @@ sub copycd {
}
}
close(LINE);
} elsif (-r $path . "/upgrade/metadata.xml") {
open(LINE,$path."/upgrade/metadata.xml");
my $detectdistname;
while (<LINE>) {
if (/esxVersion>([^<]*)</) {
my $version = $1;
while ($version =~ /\.0$/) {
$version =~ s/\.0$//;
}
$darch="x86_64";
$arch="x86_64";
$detectdistname = 'esxi' . $version;
$found=1;
} elsif (/esxRelease>([^<]*)</) {
unless ($includeupdate) {
next;
}
my $release = $1;
while ($release =~ /\.0$/) {
$release =~ s/\.0$//;
}
unless ($release ne "0") {
next;
}
$detectdistname .= '_' . $release;
}
}
unless ($distname) { $distname=$detectdistname; }
} elsif (-r $path . "/vmware-esx-base-readme") {
open(LINE,$path."/vmware-esx-base-readme");
while (<LINE>) {