From a123321552fd99d7950cf7bb62d57a1f79404ded Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 13 Jun 2018 19:24:22 -0700 Subject: [PATCH 1/3] make sure all references to the Pkg ID for previews are com.microsoft.powershell-preview fixes #7065 --- tools/packaging/packaging.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 31f5afbb817..2ddbf410963 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -618,7 +618,7 @@ function New-UnixPackage { $IsPreview = Test-IsPreview -Version $Version # Preview versions have preview in the name - $Name = if ($IsPreview -and $Environment.IsLinux) { "powershell-preview" } else { "powershell" } + $Name = if ($IsPreview) { "powershell-preview" } else { "powershell" } # Verify dependencies are installed and in the path Test-Dependencies @@ -804,7 +804,7 @@ function New-MacOsDistributionPackage # Add the OS information to the macOS package file name. $packageExt = [System.IO.Path]::GetExtension($FpmPackage.Name) - $packageNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($FpmPackage.Name) + $packageNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($FpmPackage.Name) -replace '\-preview' , '' $newPackageName = "{0}-{1}{2}" -f $packageNameWithoutExt, $script:Options.Runtime, $packageExt $newPackagePath = Join-Path $FpmPackage.DirectoryName $newPackageName From c8cb9853d6dac82785ca263e6845524b1afe31f1 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 13 Jun 2018 19:28:16 -0700 Subject: [PATCH 2/3] fix issue with replacement --- tools/packaging/packaging.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 2ddbf410963..8e3c433f677 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -804,7 +804,7 @@ function New-MacOsDistributionPackage # Add the OS information to the macOS package file name. $packageExt = [System.IO.Path]::GetExtension($FpmPackage.Name) - $packageNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($FpmPackage.Name) -replace '\-preview' , '' + $packageNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($FpmPackage.Name) -replace 'powershell\-preview' , 'powershell' $newPackageName = "{0}-{1}{2}" -f $packageNameWithoutExt, $script:Options.Runtime, $packageExt $newPackagePath = Join-Path $FpmPackage.DirectoryName $newPackageName From faeeccb814ff470b415e6516763699804a0894ca Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 13 Jun 2018 19:31:58 -0700 Subject: [PATCH 3/3] make the replace regex stricter and add a comment --- tools/packaging/packaging.psm1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 8e3c433f677..867ff105bac 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -804,7 +804,9 @@ function New-MacOsDistributionPackage # Add the OS information to the macOS package file name. $packageExt = [System.IO.Path]::GetExtension($FpmPackage.Name) - $packageNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($FpmPackage.Name) -replace 'powershell\-preview' , 'powershell' + + # get the package name from fpm without the extension, but replace powershell-preview at the beginning of the name with powershell. + $packageNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($FpmPackage.Name) -replace '^powershell\-preview' , 'powershell' $newPackageName = "{0}-{1}{2}" -f $packageNameWithoutExt, $script:Options.Runtime, $packageExt $newPackagePath = Join-Path $FpmPackage.DirectoryName $newPackageName