diff --git a/CHANGELOG.md b/CHANGELOG.md index 672a1808a9..9f4df637f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file. - [Multiple] Replace repo-reinst with kraken, handle in UIs (#3344 by: HebaruSan; reviewed: DasSkelett) - [Multiple] Make ModuleInstaller a non-singleton (#3356 by: HebaruSan; reviewed: DasSkelett) - [Core] Better recovery when registry.json is corrupted (#3351 by: HebaruSan; reviewed: DasSkelett) +- [CLI] Fix installation of metapackages on cmdline (#3362 by: DasSkelett; reviewed: HebaruSan) ### Internal diff --git a/Core/ModuleInstaller.cs b/Core/ModuleInstaller.cs index b9d75e02e3..7a84ba9b80 100644 --- a/Core/ModuleInstaller.cs +++ b/Core/ModuleInstaller.cs @@ -108,8 +108,15 @@ public static string CachedOrDownload(CkanModule module, NetModuleCache cache, s public void InstallList(List modules, RelationshipResolverOptions options, RegistryManager registry_manager, ref HashSet possibleConfigOnlyDirs, IDownloader downloader = null) { var resolver = new RelationshipResolver(modules, null, options, registry_manager.registry, ksp.VersionCriteria()); - // Only pass the CkanModules of the parameters, so we can tell which are auto - InstallList(resolver.ModList().Where(m => resolver.ReasonFor(m) is SelectionReason.UserRequested).ToList(), options, registry_manager, ref possibleConfigOnlyDirs, downloader); + // Only pass the CkanModules of the parameters, so we can tell which are auto-installed, + // and relationships of metapackages, since metapackages aren't included in the RR modlist. + var list = resolver.ModList().Where( + m => + { + var reason = resolver.ReasonFor(m); + return reason is SelectionReason.UserRequested || (reason.Parent?.IsMetapackage ?? false); + }).ToList(); + InstallList(list, options, registry_manager, ref possibleConfigOnlyDirs, downloader); } /// @@ -123,6 +130,11 @@ public void InstallList(List modules, RelationshipResolverOptions option public void InstallList(ICollection modules, RelationshipResolverOptions options, RegistryManager registry_manager, ref HashSet possibleConfigOnlyDirs, IDownloader downloader = null, bool ConfirmPrompt = true) { // TODO: Break this up into smaller pieces! It's huge! + if (modules.Count == 0) + { + User.RaiseProgress("Nothing to install.", 100); + return; + } var resolver = new RelationshipResolver(modules, null, options, registry_manager.registry, ksp.VersionCriteria()); var modsToInstall = resolver.ModList().ToList(); List downloads = new List();