Fix building on RedHat Enterprise Linux (#7489)

When trying to build on RHEL, the environment is not recognized as RedHatFamily.
Added detection logic so that appropriate symbolic links are generated.
This commit is contained in:
Aditya Patwardhan 2018-08-14 13:21:26 -07:00 committed by Travis Plunk
parent 820286e117
commit ee33db0798

View file

@ -140,9 +140,11 @@ function Get-EnvironmentInformation
$environment += @{'IsFedora' = $LinuxInfo.ID -match 'fedora' -and $LinuxInfo.VERSION_ID -ge 24}
$environment += @{'IsOpenSUSE' = $LinuxInfo.ID -match 'opensuse'}
$environment += @{'IsSLES' = $LinuxInfo.ID -match 'sles'}
$environment += @{'IsRedHat' = $LinuxInfo.ID -match 'rhel'}
$environment += @{'IsRedHat7' = $Environment.IsRedHat -and $LinuxInfo.VERSION_ID -match '7' }
$environment += @{'IsOpenSUSE13' = $Environmenst.IsOpenSUSE -and $LinuxInfo.VERSION_ID -match '13'}
$environment += @{'IsOpenSUSE42.1' = $Environment.IsOpenSUSE -and $LinuxInfo.VERSION_ID -match '42.1'}
$environment += @{'IsRedHatFamily' = $Environment.IsCentOS -or $Environment.IsFedora}
$environment += @{'IsRedHatFamily' = $Environment.IsCentOS -or $Environment.IsFedora -or $Environment.IsRedHat}
$environment += @{'IsSUSEFamily' = $Environment.IsSLES -or $Environment.IsOpenSUSE}
# Workaround for temporary LD_LIBRARY_PATH hack for Fedora 24
@ -151,6 +153,15 @@ function Get-EnvironmentInformation
Remove-Item -Force ENV:\LD_LIBRARY_PATH
Get-ChildItem ENV:
}
if( -not(
$environment.IsDebian -or
$environment.IsUbuntu -or
$environmment.IsRedHatFamily -or
$environmment.IsSUSEFamily)
) {
throw "The current OS : $($LinuxInfo.ID) is not supported for building PowerShell."
}
}
return [PSCustomObject] $environment