-
Notifications
You must be signed in to change notification settings - Fork 8.2k
[release/v7.5] Remove usage of fpm for DEB package generation #26809
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
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,10 +21,7 @@ Describe "Linux Package Name Validation" { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| It "Should have valid RPM package names" { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $rpmPackages = Get-ChildItem -Path $artifactsDir -Recurse -Filter *.rpm -ErrorAction SilentlyContinue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($rpmPackages.Count -eq 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Set-ItResult -Skipped -Because "No RPM packages found in artifacts directory" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $rpmPackages.Count | Should -BeGreaterThan 0 -Because "At least one RPM package should exist in the artifacts directory" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $invalidPackages = @() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Regex pattern for valid RPM package names. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -49,19 +46,50 @@ Describe "Linux Package Name Validation" { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($invalidPackages.Count -gt 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw ($invalidPackages | Out-String) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Context "DEB Package Names" { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| It "Should have valid DEB package names" { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $debPackages = Get-ChildItem -Path $artifactsDir -Recurse -Filter *.deb -ErrorAction SilentlyContinue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $debPackages.Count | Should -BeGreaterThan 0 -Because "At least one DEB package should exist in the artifacts directory" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $invalidPackages = @() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Regex pattern for valid DEB package names. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Valid examples: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - powershell-preview_7.6.0-preview.6-1.deb_amd64.deb | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - powershell-lts_7.4.13-1.deb_amd64.deb | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - powershell_7.4.13-1.deb_amd64.deb | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Breakdown: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ^powershell : Starts with 'powershell' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # (-preview|-lts)? : Optionally '-preview' or '-lts' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # _\d+\.\d+\.\d+ : Underscore followed by version number (e.g., _7.6.0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # (-[a-z]+\.\d+)? : Optional dash, letters, dot, and digits (e.g., -preview.6) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # -1 : Literal '-1' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # \.deb_ : Literal '.deb_' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # (amd64|arm64) : Architecture | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # \.deb$ : File extension | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $debPackageNamePattern = '^powershell(-preview|-lts)?_\d+\.\d+\.\d+(-[a-z]+\.\d+)?-1\.deb_(amd64|arm64)\.deb$' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+61
to
+73
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - powershell-preview_7.6.0-preview.6-1.deb_amd64.deb | |
| # - powershell-lts_7.4.13-1.deb_amd64.deb | |
| # - powershell_7.4.13-1.deb_amd64.deb | |
| # Breakdown: | |
| # ^powershell : Starts with 'powershell' | |
| # (-preview|-lts)? : Optionally '-preview' or '-lts' | |
| # _\d+\.\d+\.\d+ : Underscore followed by version number (e.g., _7.6.0) | |
| # (-[a-z]+\.\d+)? : Optional dash, letters, dot, and digits (e.g., -preview.6) | |
| # -1 : Literal '-1' | |
| # \.deb_ : Literal '.deb_' | |
| # (amd64|arm64) : Architecture | |
| # \.deb$ : File extension | |
| $debPackageNamePattern = '^powershell(-preview|-lts)?_\d+\.\d+\.\d+(-[a-z]+\.\d+)?-1\.deb_(amd64|arm64)\.deb$' | |
| # - powershell-preview_7.6.0-preview.6-1_amd64.deb | |
| # - powershell-lts_7.4.13-1_amd64.deb | |
| # - powershell_7.4.13-1_amd64.deb | |
| # Breakdown: | |
| # ^powershell : Starts with 'powershell' | |
| # (-preview|-lts)? : Optionally '-preview' or '-lts' | |
| # _\d+\.\d+\.\d+ : Underscore followed by version number (e.g., _7.6.0) | |
| # (-[a-z]+\.\d+)? : Optional dash, letters, dot, and digits (e.g., -preview.6) | |
| # -1 : Literal '-1' | |
| # _ : Underscore separating version/build from architecture | |
| # (amd64|arm64) : Architecture | |
| # \.deb$ : File extension | |
| $debPackageNamePattern = '^powershell(-preview|-lts)?_\d+\.\d+\.\d+(-[a-z]+\.\d+)?-1_(amd64|arm64)\.deb$' |
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 DEB package name pattern is incorrect and doesn't match the actual filenames generated by New-NativeDeb. The pattern expects
-1\.deb_(line 70, 73), but the actual iteration can be "1.deb" OR distribution-specific like "1.ubuntu.20.04" (see packaging.psm1:1125 where Iteration is appended with distribution). The generated filename format is${Name}_${Version}-${Iteration}_${HostArchitecture}.deb(packaging.psm1:1898), which produces names likepowershell_7.4.13-1.ubuntu.20.04_amd64.deb, notpowershell_7.4.13-1.deb_amd64.deb. The pattern should be:^powershell(-preview|-lts)?_\d+\.\d+\.\d+(-[a-z]+\.\d+)?-\d+(\.[a-z]+\.\d+(\.\d+)?)?_(amd64|arm64)\.deb$to match both "1.deb" and "1.ubuntu.20.04" style iterations.