Change packaging to differentiate only between major versions and previews (#6968)

Change the *nix packaging over with the following changes:

Package name (as used by e.g. apt):
Non-preview releases are namedpowershell
Preview releases are named powershell-preview
Installation path:
No longer looks like /opt/microsoft/powershell/6.1.0/ or /opt/microsoft/powershell/6.1.0-preview.1/
Non-previews go to a path like /opt/microsoft/powershell/6/
Previews go to a path like /opt/microsoft/powershell/6-preview/
Path to executable symlink:
Allows SxS with preview
Non-previews linked to /usr/bin/pwsh or /usr/local/bin/pwsh on macOS
Previews linked to /usr/bin/pwsh-preview or /usr/local/bin/pwsh-preview on macOS
Implements PowerShell/PowerShell-RFC#115 (comment)
This commit is contained in:
Robert Holt 2018-06-05 12:51:47 -07:00 committed by Travis Plunk
parent 2ec3056f9e
commit f559acfae1
3 changed files with 15 additions and 11 deletions

View file

@ -405,7 +405,7 @@ OPTIONS="-o Debug::NoLocking=1
-o APT::Install-Suggests=0
"
cp ../powershell_*ubuntu.14.04_amd64.deb .
cp ../powershell*ubuntu.14.04_amd64.deb .
# Add local repository so that we can install deb files
# that were downloaded outside of a repository

View file

@ -600,17 +600,23 @@ function New-UnixPackage {
}
}
# Determine if the version is a preview version
$IsPreview = $Version.Contains("-preview")
# Preview versions have preview in the name
$Name = if ($IsPreview) { "powershell-preview" } else { "powershell" }
# Verify dependencies are installed and in the path
Test-Dependencies
$Description = $packagingStrings.Description
# Suffix is used for side-by-side package installation
$Suffix = $Name -replace "^powershell"
if (!$Suffix) {
Write-Verbose "Suffix not given, building primary PowerShell package!"
$Suffix = $packageVersion
}
# Break the version down into its components, we are interested in the major version
$VersionMatch = [regex]::Match($Version, '(\d+)(?:.(\d+)(?:.(\d+)(?:-preview(?:.(\d+))?)?)?)?')
$MajorVersion = $VersionMatch.Groups[1].Value
# Suffix is used for side-by-side preview/release package installation
$Suffix = if ($IsPreview) { $MajorVersion + "-preview" } else { $MajorVersion }
# Setup staging directory so we don't change the original source directory
$Staging = "$PSScriptRoot/staging"
@ -627,9 +633,9 @@ function New-UnixPackage {
# Destination for symlink to powershell executable
$Link = if ($Environment.IsLinux) {
"/usr/bin/"
if ($IsPreview) { "/usr/bin/pwsh-preview" } else { "/usr/bin/pwsh" }
} elseif ($Environment.IsMacOS) {
"/usr/local/bin/"
if ($IsPreview) { "/usr/local/bin/pwsh-preview" } else { "/usr/local/bin/pwsh" }
}
$linkSource = "/tmp/pwsh"

View file

@ -269,8 +269,6 @@ elseif($Stage -eq 'Build')
# Only build packages for branches, not pull requests
$packages = @(Start-PSPackage @packageParams -SkipReleaseChecks)
# Packaging AppImage depends on the deb package
$packages += Start-PSPackage @packageParams -Type AppImage -SkipReleaseChecks
foreach($package in $packages)
{
# Publish the packages to the nuget feed if: