-
Notifications
You must be signed in to change notification settings - Fork 8.1k
[release/v7.4] Update the macos package name for preview releases to match the previous pattern #26435
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
base: release/v7.4
Are you sure you want to change the base?
[release/v7.4] Update the macos package name for preview releases to match the previous pattern #26435
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -82,12 +82,13 @@ Describe "Verify macOS Package" { | |||||
| $script:package | Should -Not -BeNullOrEmpty | ||||||
|
|
||||||
| # Regex pattern for valid macOS PKG package names. | ||||||
| # This pattern matches the validation used in release-validate-packagenames.yml | ||||||
| # Valid examples: | ||||||
| # - powershell-7.4.13-osx-x64.pkg (Intel x64 - note: x64 with hyphens for compatibility) | ||||||
| # - powershell-7.4.13-osx-arm64.pkg (Apple Silicon) | ||||||
| # - powershell-preview-7.6.0-preview.6-osx-x64.pkg | ||||||
| # - powershell-lts-7.4.13-osx-arm64.pkg | ||||||
| $pkgPackageNamePattern = '^powershell(-preview|-lts)?-\d+\.\d+\.\d+(-[a-z]+\.\d+)?-osx-(x64|arm64)\.pkg$' | ||||||
| # - powershell-7.4.13-osx-x64.pkg (Stable release) | ||||||
| # - powershell-7.6.0-preview.6-osx-x64.pkg (Preview version string) | ||||||
| # - powershell-7.4.13-rebuild.5-osx-arm64.pkg (Rebuild version) | ||||||
| # - powershell-lts-7.4.13-osx-arm64.pkg (LTS package) | ||||||
| $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg$' | ||||||
|
||||||
| $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg$' | |
| $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*\.\d+\-)?osx\-(x64|arm64)\.pkg$' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1145,15 +1145,12 @@ function New-UnixPackage { | |
| } | ||
|
|
||
| # Determine if the version is a preview version | ||
| $IsPreview = Test-IsPreview -Version $Version -IsLTS:$LTS | ||
|
|
||
| # Preview versions have preview in the name | ||
| # Only LTS packages get a prefix in the name | ||
| # Preview versions are identified by the version string itself (e.g., 7.6.0-preview.6) | ||
| # Rebuild versions are also identified by the version string (e.g., 7.4.13-rebuild.5) | ||
|
Comment on lines
1147
to
+1150
|
||
| $Name = if($LTS) { | ||
| "powershell-lts" | ||
| } | ||
| elseif ($IsPreview) { | ||
| "powershell-preview" | ||
| } | ||
| else { | ||
| "powershell" | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern uses an unescaped
.which matches any character, not just a literal dot. In the pattern[a-z]*., the dot should be escaped as\.to specifically match the dot in version suffixes like "preview.6" or "rebuild.5".Currently, the pattern would incorrectly match malformed names like:
[email protected]powershell-7.4.13-rebuild-5-osx-arm64.pkgFix: Escape the dot in the pattern: