Commit 0774f8f9 authored by David McFarland's avatar David McFarland
Browse files

dotnet: add patch to fix fetch-deps in dotnet 9 VMR

parent ae7b2ae6
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
From 93137ea040472f4042dd186427699ad249e7251b Mon Sep 17 00:00:00 2001
From: David McFarland <corngood@gmail.com>
Date: Sun, 22 Sep 2024 16:41:07 -0300
Subject: [PATCH] UpdateNuGetConfigPackageSourcesMappings: don't add empty
 mappings

---
 .../UpdateNuGetConfigPackageSourcesMappings.cs              | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs b/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs
index 3b188c1801..9b7050ef46 100644
--- a/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs
+++ b/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs
@@ -115,7 +115,11 @@ namespace Microsoft.DotNet.UnifiedBuild.Tasks
                 // Skip sources with zero package patterns
                 if (allSourcesPackages[packageSource]?.Count > 0)
                 {
-                    pkgSrcMappingClearElement.AddAfterSelf(GetPackageMappingsElementForSource(packageSource));
+                    var pkgSrc = GetPackageMappingsElementForSource(packageSource);
+                    if (pkgSrc.Elements().Any())
+                    {
+                        pkgSrcMappingClearElement.AddAfterSelf(pkgSrc);
+                    }
                 }
             }
 
-- 
2.46.0
+3 −1
Original line number Diff line number Diff line
@@ -138,7 +138,9 @@ stdenv.mkDerivation rec {
                       (global-name "com.apple.system.opendirectoryd.membership"))
  '';

  patches = lib.optionals (lib.versionOlder version "9") [
  patches = lib.optionals (lib.versionAtLeast version "9") [
    ./UpdateNuGetConfigPackageSourcesMappings-don-t-add-em.patch
  ] ++ lib.optionals (lib.versionOlder version "9") [
    ./fix-aspnetcore-portable-build.patch
  ];