Merged PR 17704: Fix rpm packaging

Fix rpm packaging to use `$Distribution` instead of the environment check because we are not building rpm packages on a RedHat family machine.
This commit is contained in:
Dongbo Wang 2021-10-21 05:16:47 +00:00
parent aab7bc935a
commit 141bd8154c

View file

@ -1247,10 +1247,9 @@ function Get-FpmArguments
"-t", $Type,
"-s", "dir"
)
if ($Environment.IsRedHatFamily) {
if ($Distribution -eq 'rh') {
$Arguments += @("--rpm-dist", $Distribution)
$Arguments += @("--rpm-os", "linux")
$Arguments += @("--rpm-os", "linux")
$Arguments += @("--license", "MIT")
} else {
$Arguments += @("--license", "MIT License")
@ -1368,7 +1367,7 @@ function New-AfterScripts
Write-Verbose -Message "AfterScript Distribution: $Distribution" -Verbose
if ($Environment.IsRedHatFamily) {
if ($Distribution -eq 'rh') {
$AfterInstallScript = (Join-Path $env:HOME $([System.IO.Path]::GetRandomFileName()))
$AfterRemoveScript = (Join-Path $env:HOME $([System.IO.Path]::GetRandomFileName()))
$packagingStrings.RedHatAfterInstallScript -f "$Link", $Destination | Out-File -FilePath $AfterInstallScript -Encoding ascii