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:
parent
021b4c69fb
commit
d183a0bb9d
@ -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)
|
||||
{
|
||||
|
@ -4333,10 +4333,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){
|
||||
@ -4428,6 +4430,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>) {
|
||||
|
Loading…
Reference in New Issue
Block a user