Skip to content

Commit

Permalink
Merged PR 27614: Remove HostArchitecture dynamic parameter for `osx…
Browse files Browse the repository at this point in the history
…pkg` (#19917)

Remove `HostArchitecture` dynamic parameter for `osxpkg` (#19917)
  • Loading branch information
daxian-dbw committed Sep 14, 2023
1 parent cfcfdd3 commit aa57c66
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,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 @@ -908,19 +911,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 @@ -974,7 +964,6 @@ function New-UnixPackage {
throw ($ErrorMessage -f "macOS")
}

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

0 comments on commit aa57c66

Please sign in to comment.