From 769b02ab984f7e5a98a129577f103a5525d672e7 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 14 Aug 2018 10:15:05 -0700 Subject: [PATCH] Save modules to un-versioned folder to enable servicing (#7518) Remove code from build.psm1 that save the modules to a versioned folder. For servicing reasons after release it is preferred and easier to not have the versioned folder so that we can directly replace modules that need to be serviced (MSI specifically makes it difficult to service a module if the folder path changes). --- assets/files.wxs | 114 +++++++++--------- build.psm1 | 9 +- .../Modules/PSReadLine/PSReadLine.Tests.ps1 | 2 +- .../engine/Help/UpdatableHelpSystem.Tests.ps1 | 12 +- 4 files changed, 65 insertions(+), 72 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index 70b6363158..17ab216bb2 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -1646,124 +1646,124 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1785,23 +1785,23 @@ - + - + - + - + - + - + @@ -1809,32 +1809,32 @@ - + - + - + - + - + - + - + - + - + @@ -1842,10 +1842,10 @@ - + - + @@ -1902,17 +1902,17 @@ - + - + - + - + diff --git a/build.psm1 b/build.psm1 index 668e3beeb4..ea6643f55d 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2460,16 +2460,9 @@ function Copy-PSGalleryModules $version } - # Remove semantic version in the destination directory - $destVer = if ($version -match "(\d+.\d+.\d+)-.+") { - $matches[1] - } else { - $version - } - # Nuget seems to always use lowercase in the cache $src = "$nugetCache/$($name.ToLower())/$srcVer" - $dest = "$Destination/$name/$destVer" + $dest = "$Destination/$name" Remove-Item -Force -ErrorAction Ignore -Recurse "$Destination/$name" New-Item -Path $dest -ItemType Directory -Force -ErrorAction Stop > $null diff --git a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 index e66a143507..4d7358e306 100644 --- a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 +++ b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 @@ -13,7 +13,7 @@ Describe "PSReadLine" -tags "CI" { $module = Get-Module PSReadLine $module.Name | Should -BeExactly 'PSReadLine' $module.Version | Should -BeExactly '2.0.0' - $module.Path | Should -Be (Join-Path -Path $PSHOME -ChildPath "Modules/PSReadLine/2.0.0/PSReadLine.psm1") + $module.Path | Should -Be (Join-Path -Path $PSHOME -ChildPath "Modules/PSReadLine/PSReadLine.psm1") } It "Should use Emacs Bindings on Linux and macOS" -skip:$IsWindows { diff --git a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 index e976906be5..eab542cd89 100644 --- a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 @@ -132,24 +132,24 @@ $testCases = @{ HelpFiles = "Microsoft.PowerShell.PackageManagement.dll-help.xml" HelpInfoFiles = "PackageManagement_4ae9fd46-338a-459c-8186-07f910774cb8_HelpInfo.xml" CompressedFiles = "PackageManagement_4ae9fd46-338a-459c-8186-07f910774cb8_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\Modules\PackageManagement\*\en-US" - HelpInstallationPathHome = "$userHelpRoot\PackageManagement\*\en-US" + HelpInstallationPath = "$pshome\Modules\PackageManagement\en-US" + HelpInstallationPathHome = "$userHelpRoot\PackageManagement\en-US" } "PowershellGet" = @{ HelpFiles = "PSGet.psm1-help.xml" HelpInfoFiles = "PowershellGet_1d73a601-4a6c-43c5-ba3f-619b18bbb404_HelpInfo.xml" CompressedFiles = "PowershellGet_1d73a601-4a6c-43c5-ba3f-619b18bbb404_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\Modules\PowershellGet\*\en-US" - HelpInstallationPathHome = "$userHelpRoot\PackageManagement\*\en-US" + HelpInstallationPath = "$pshome\Modules\PowershellGet\en-US" + HelpInstallationPathHome = "$userHelpRoot\PackageManagement\en-US" } "PSReadline" = @{ HelpFiles = "Microsoft.PowerShell.PSReadLine.dll-help.xml" HelpInfoFiles = "PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_HelpInfo.xml" CompressedFiles = "PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\Modules\PSReadLine\2.0.0\en-US" - HelpInstallationPathHome = "$userHelpRoot\PSReadLine\2.0.0\en-US" + HelpInstallationPath = "$pshome\Modules\PSReadLine\en-US" + HelpInstallationPathHome = "$userHelpRoot\PSReadLine\en-US" } }