Merge pull request #334 from Icinga:fix/missing_architecture_check

Fix: Missing architecture check on installation from repository

The architecture check was missing from the Icinga Repository installation, causing x86 packages being installed on x64 systems and vice versa.
This commit is contained in:
Lord Hepipud 2021-08-17 21:49:30 +02:00 committed by GitHub
commit 16bff293ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,7 @@ function Get-IcingaRepositoryPackage()
$SourceRepo = $null;
$RepoName = $null;
[bool]$HasRepo = $FALSE;
[bool]$Isx86 = [bool]([IntPtr]::Size -eq 4);
foreach ($entry in $Repositories) {
$RepoContent = Read-IcingaRepositoryFile -Name $entry.Name;
@ -45,6 +46,10 @@ function Get-IcingaRepositoryPackage()
continue;
}
if ($package.Architecture -ne 'Multi' -And $package.Architecture -eq 'x86' -And $Isx86 -eq $FALSE) {
continue;
}
if ([string]::IsNullOrEmpty($Version) -And ($null -eq $LatestVersion -Or $LatestVersion -lt $package.Version)) {
[Version]$LatestVersion = [Version]$package.Version;
$InstallPackage = $package;