Skip to content

Commit aa57c66

Browse files
committed
Merged PR 27614: Remove HostArchitecture dynamic parameter for osxpkg (#19917)
Remove `HostArchitecture` dynamic parameter for `osxpkg` (#19917)
1 parent cfcfdd3 commit aa57c66

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

tools/packaging/packaging.psm1

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,11 @@ function New-UnixPackage {
870870
# This is a string because strings are appended to it
871871
[string]$Iteration = "1",
872872

873+
# Host architecture values allowed for deb type packages: amd64
874+
# Host architecture values allowed for rpm type packages include: x86_64, aarch64, native, all, noarch, any
875+
# Host architecture values allowed for osxpkg type packages include: x86_64, arm64
873876
[string]
874-
[ValidateSet("x86_64", "amd64", "aarch64", "native", "all", "noarch", "any")]
877+
[ValidateSet("x86_64", "amd64", "aarch64", "arm64", "native", "all", "noarch", "any")]
875878
$HostArchitecture,
876879

877880
[Switch]
@@ -908,19 +911,6 @@ function New-UnixPackage {
908911

909912
$Dict.Add("Distribution", $Parameter) > $null
910913
return $Dict
911-
} elseif ($Type -eq "osxpkg") {
912-
# Add a dynamic parameter '-HostArchitecture' when the specified package type is 'osxpkg'.
913-
# The '-HostArchitecture' parameter is used to indicate which Mac processor this package is targeting,
914-
# Intel (x86_64) or Apple Silicon (arm64).
915-
$ParameterAttr = New-Object "System.Management.Automation.ParameterAttribute"
916-
$ValidateSetAttr = New-Object "System.Management.Automation.ValidateSetAttribute" -ArgumentList "x86_64", "arm64"
917-
$Attributes = New-Object "System.Collections.ObjectModel.Collection``1[System.Attribute]"
918-
$Attributes.Add($ParameterAttr) > $null
919-
$Attributes.Add($ValidateSetAttr) > $null
920-
$Parameter = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("HostArchitecture", [string], $Attributes)
921-
$Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary"
922-
$Dict.Add("HostArchitecture", $Parameter) > $null
923-
return $Dict
924914
}
925915
}
926916

@@ -974,7 +964,6 @@ function New-UnixPackage {
974964
throw ($ErrorMessage -f "macOS")
975965
}
976966

977-
$HostArchitecture = $PSBoundParameters['HostArchitecture']
978967
$DebDistro = 'macOS'
979968
}
980969
}

0 commit comments

Comments
 (0)