From fda83652df6bc033721c6d4cb7d65019ef9b51df Mon Sep 17 00:00:00 2001 From: Alexandr Morogov <42555001+krankenbro@users.noreply.github.com> Date: Fri, 13 Aug 2021 15:14:29 +0200 Subject: [PATCH] VCI-116: Fix modules installation (#11) --- PlatformTools/Build.PackageManager.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/PlatformTools/Build.PackageManager.cs b/PlatformTools/Build.PackageManager.cs index 3307cd5..d1635ec 100644 --- a/PlatformTools/Build.PackageManager.cs +++ b/PlatformTools/Build.PackageManager.cs @@ -69,6 +69,12 @@ internal partial class Build continue; } + if (!string.IsNullOrEmpty(module.Version) && externalModule.Version.CompareTo(module.Version) > 0) + { + Logger.Error($"The latest available version of module ${module.Id} is ${externalModule.Version}, but entered: ${module.Version}"); + continue; + } + module.Id = externalModule.Id; module.Version = module.Version.EmptyToNull() ?? externalModule.Version.ToString(); @@ -259,11 +265,14 @@ private bool NeedToInstallPlatform(string version) .Except(modulesToInstall) .OfType() .ToList(); - modulesToInstall.AddRange(missingModules); } + modulesToInstall.ForEach(module => + { + module.DependsOn.Clear(); + }); + moduleInstaller.Install(modulesToInstall, progress); - moduleInstaller.Install(modulesToInstall.Where(m => !m.IsInstalled), progress); localModuleCatalog.Reload(); });