OneGet / oneget

PackageManagement (aka OneGet) is a package manager for Windows
MIT License
2.38k stars 190 forks source link

Get-PackageSource not updated after registering a new one #386

Open edyoung opened 5 years ago

edyoung commented 5 years ago

Repro:

> Register-PackageSource -ProviderName ChocolateyGet -Location http://chocolatey.org/api/v2/ -Name chocolatey

> Get-PackageSource
Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
nuget.org                        NuGet            False      https://api.nuget.org/v3/index.json
CliFallbackFolder                NuGet            False      C:\Users\edwin\.dotnet\NuGetFallbackFolder
Official                         NuGet            False      https://msazure.pkgs.visualstudio.com/DefaultCollection...
Dev                              NuGet            False      https://msazure.pkgs.visualstudio.com/DefaultCollection...
Local                            PowerShellGet    True       C:\Users\edwin\Source\Repos\PowerShellGet\tests\PSGalle...
poshtestgallery                  PowerShellGet    True       https://www.poshtestgallery.com/api/v2
PSGallery                        PowerShellGet    True       https://www.powershellgallery.com/api/v2
GalleryRolling                   PowerShellGet    True       https://www.poshtestgallery.com/api/v2/

> get-packagesource chocolatey

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
chocolatey                       ChocolateyGet    False      https://www.chocolatey.org

Expected: show me the source I just registered.

edyoung commented 5 years ago

It looks like Register-PackageSource is not working correctly.

Register-PackageSource -ProviderName ChocolateyGet -Location http://chocol
atey.org/api/v2/ -Name chocolatey -Verbose -Debug
DEBUG: 00:00:00.0000005 Calling New() : MethodName = 'GetDynamicOptions'

Confirm
Continue with this operation?
[Y] Yes  [A] Yes to All  [H] Halt Command  [S] Suspend  [?] Help (default is "Y"): a
DEBUG: 00:00:00.0000849 Location: http://chocolatey.org/api/v2/
DEBUG: 00:00:00.0001548 Verbose: True
DEBUG: 00:00:00.0002030 Debug: True
DEBUG: 00:00:00.0002491 Name: chocolatey
DEBUG: 00:00:00.0027701 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0054860 'ChocolateyGet': 'Get-DynamicOptions'.
DEBUG: 00:00:00.0059628 PowerShell Script 'ChocolateyGet' Function 'Get-DynamicOptions' returns null.
DEBUG: 00:00:00.0084389 Done calling powershell «Get-DynamicOptions» «ChocolateyGet»
DEBUG: 00:00:00.0243814 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0244629 Location: http://chocolatey.org/api/v2/
DEBUG: 00:00:00.0245143 Verbose: True
DEBUG: 00:00:00.0245602 Debug: True
DEBUG: 00:00:00.0246065 Name: chocolatey
DEBUG: 00:00:00.0269674 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0299808 'ChocolateyGet': 'Get-DynamicOptions'.
DEBUG: 00:00:00.0305131 PowerShell Script 'ChocolateyGet' Function 'Get-DynamicOptions' returns null.
DEBUG: 00:00:00.0327446 Done calling powershell «Get-DynamicOptions» «ChocolateyGet»
DEBUG: 00:00:02.8588444 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:02.8589071 Location: http://chocolatey.org/api/v2/
DEBUG: 00:00:02.8589411 ProviderName: ChocolateyGet
DEBUG: 00:00:02.8589564 Verbose: True
DEBUG: 00:00:02.8589705 Debug: True
DEBUG: 00:00:02.8589848 Name: chocolatey
DEBUG: 00:00:02.8600533 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:02.8709887 'ChocolateyGet': 'Resolve-PackageSource'.
DEBUG: 00:00:02.8711715 PowerShell Script 'ChocolateyGet' Function 'Resolve-PackageSource' returns null.
DEBUG: 00:00:02.8722841 Done calling powershell «Resolve-PackageSource» «ChocolateyGet»

Confirm
Are you sure you want to perform this action?
Performing the operation "Register Package Source." on target "Package Source 'chocolatey'
(http://chocolatey.org/api/v2/) in provider 'ChocolateyGet'.".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): a
edyoung commented 5 years ago

Maybe this is expected? I can run Install-Package -Source chocolatey successfully. But the behavior is weird.