Skip to content

Commit f6864bf

Browse files
authored
Merge pull request #3850 from gep13/more-package-info
(#3849) Use new AvailableVersionSource property
2 parents 2cdf159 + 1b85959 commit f6864bf

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

NuGet.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<config>
4+
<add key="globalPackagesFolder" value=".\src\packages" />
5+
</config>
6+
</configuration>

src/chocolatey/chocolatey.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
</ItemGroup>
9494
<ItemGroup>
9595
<PackageReference Include="AlphaFS" Version="2.2.6" />
96-
<PackageReference Include="Chocolatey.NuGet.PackageManagement" Version="3.4.3" />
96+
<PackageReference Include="Chocolatey.NuGet.PackageManagement" Version="3.5.0-alpha-20260227-1505" />
9797
<PackageReference Include="log4net" Version="3.2.0" />
9898
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
9999
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers">

src/chocolatey/infrastructure.app/nuget/NugetList.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ public static IPackageSearchMetadata FindPackage(
421421

422422
if (!(package is null))
423423
{
424+
package.AvailableVersionSource = resource.Source.PackageSource.Source;
424425
packagesList.Add(package);
425426
}
426427
}
@@ -432,6 +433,11 @@ public static IPackageSearchMetadata FindPackage(
432433
throwError: false,
433434
logWarningInsteadOfError: true).OrEmpty();
434435

436+
foreach (var package in packages)
437+
{
438+
package.AvailableVersionSource = resource.Source.PackageSource.Source;
439+
}
440+
435441
packagesList.AddRange(packages);
436442
}
437443
}
@@ -445,6 +451,7 @@ public static IPackageSearchMetadata FindPackage(
445451

446452
if (!(package is null))
447453
{
454+
package.AvailableVersionSource = resource.Source.PackageSource.Source;
448455
packagesList.Add(package);
449456
}
450457
}

update-nuget-client.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ if ($build -or !(Test-Path "$sourceLocation\artifacts")) {
3232
}
3333

3434
Get-ChildItem "$thisLocation\src\packages\Chocolatey.NuGet.*" | ForEach-Object {
35-
$name = $_.Name -replace "^Chocolatey\.NuGet([^\d]+)(\.\d.*)$", "NuGet`$1"
35+
$name = $_.Name -replace "^Chocolatey\.NuGet([^\d]+)$", "NuGet`$1"
36+
37+
$packageDirectory = $_.FullName
38+
$versionDirectory = Get-ChildItem -Path $packageDirectory -Directory | Sort-Object Name -Descending | Select-Object -First 1
39+
$destination = Join-Path $versionDirectory.FullName 'lib'
3640

37-
$destination = "$($_.FullName)\lib"
3841
Remove-Item "$destination\*\*"
3942

4043
Get-ChildItem "$sourceLocation\artifacts\$name\bin\Debug" -Directory | ForEach-Object {

0 commit comments

Comments
 (0)