Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
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