Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove HostArchitecture dynamic for osxpkg #19917

Merged
merged 1 commit into from Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 4 additions & 15 deletions tools/packaging/packaging.psm1
Expand Up @@ -953,8 +953,11 @@ function New-UnixPackage {
# This is a string because strings are appended to it
[string]$Iteration = "1",

# Host architecture values allowed for deb type packages: amd64
# Host architecture values allowed for rpm type packages include: x86_64, aarch64, native, all, noarch, any
# Host architecture values allowed for osxpkg type packages include: x86_64, arm64
[string]
[ValidateSet("x86_64", "amd64", "aarch64", "native", "all", "noarch", "any")]
[ValidateSet("x86_64", "amd64", "aarch64", "arm64", "native", "all", "noarch", "any")]
$HostArchitecture,

[Switch]
Expand Down Expand Up @@ -991,19 +994,6 @@ function New-UnixPackage {

$Dict.Add("Distribution", $Parameter) > $null
return $Dict
} elseif ($Type -eq "osxpkg") {
# Add a dynamic parameter '-HostArchitecture' when the specified package type is 'osxpkg'.
# The '-HostArchitecture' parameter is used to indicate which Mac processor this package is targeting,
# Intel (x86_64) or Apple Silicon (arm64).
$ParameterAttr = New-Object "System.Management.Automation.ParameterAttribute"
$ValidateSetAttr = New-Object "System.Management.Automation.ValidateSetAttribute" -ArgumentList "x86_64", "arm64"
$Attributes = New-Object "System.Collections.ObjectModel.Collection``1[System.Attribute]"
$Attributes.Add($ParameterAttr) > $null
$Attributes.Add($ValidateSetAttr) > $null
$Parameter = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("HostArchitecture", [string], $Attributes)
$Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary"
$Dict.Add("HostArchitecture", $Parameter) > $null
return $Dict
}
}

Expand Down Expand Up @@ -1057,7 +1047,6 @@ function New-UnixPackage {
throw ($ErrorMessage -f "macOS")
}

$HostArchitecture = $PSBoundParameters['HostArchitecture']
$DebDistro = 'macOS'
}
}
Expand Down