Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installation of metapackages on cmdline #3362

Merged
merged 1 commit into from
May 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Core/ModuleInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,15 @@ public static string CachedOrDownload(CkanModule module, NetModuleCache cache, s
public void InstallList(List<string> modules, RelationshipResolverOptions options, RegistryManager registry_manager, ref HashSet<string> 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);
}

/// <summary>
Expand All @@ -123,6 +130,11 @@ public void InstallList(List<string> modules, RelationshipResolverOptions option
public void InstallList(ICollection<CkanModule> modules, RelationshipResolverOptions options, RegistryManager registry_manager, ref HashSet<string> 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<CkanModule> downloads = new List<CkanModule>();
Expand Down