}\r
}\r
\r
+ Installation[] depInstallations;\r
+ {\r
+ Installation[] resolved;\r
+ DependeciesResolver.ResolveInstallations(installations, pkgListMan, out resolved, out depInstallations);\r
+ installations = resolved;\r
+ }\r
+ \r
Console.WriteLine("The following packages will be downloaded:");\r
Console.WriteLine(" {0}", Installation.ToString(installations));\r
if (AllGet.Util.Confirm("Do you want to continue [Y/n]?", true) == false) {\r
{\r
List<Installation> reqInsts = new List<Installation>();\r
\r
- foreach (Entry entry in DeleteDuplicatedEntries(CreateDependencyEntries(insts, "Requires"))) {\r
+ foreach (Entry entry in DeleteDuplicatedEntries(CreateRequiresEntries(insts))) {\r
if (!pkgListsMan.IsInstalledFor(entry)) { \r
if (Array.Exists(insts, delegate(Installation inst) {\r
return inst.InstalledPackage.Name == entry.Name;\r
}\r
\r
/// <summary>\r
- /// 指定した依存エントリのイテレータを返す\r
+ /// Requires依存エントリのイテレータを返す\r
/// </summary>\r
/// <remarks>現段階の実装では再帰的な依存は検索しない</remarks>\r
/// <param name="insts">対象のインストールリスト</param>\r
- /// <param name="dependencyName">依存の種類名。<code>Package</code>クラスのフィールド名を入れる</param>\r
/// <returns>依存エントリのイテレータ。重複に関して解決は行わない</returns>\r
- /// <exception cref="ArgumentException"><code>dependencyName</code>が不正であった場合</exception>\r
- public static IEnumerable<Entry> CreateDependencyEntries(Installation[] insts, string dependencyName)\r
+ private static IEnumerable<Entry> CreateRequiresEntries(Installation[] insts)\r
{\r
- FieldInfo depFInfo = null;\r
- \r
- try {\r
- depFInfo = typeof(Installation).GetField(dependencyName, BindingFlags.Public);\r
- if (depFInfo.FieldType != typeof(Installation[])) throw new ApplicationException("Field type does not Installation[].");\r
- } catch (Exception ex) {\r
- throw new ArgumentException("Not suitable dependencyName", "dependencyName", ex);\r
- }\r
- \r
foreach (Installation inst in insts) {\r
- Entry[] deps = (Entry[]) depFInfo.GetValue(inst);\r
+ Entry[] deps = inst.InstalledPackage.Requires;\r
if (deps == null) continue;\r
foreach (Entry dep in deps) {\r
yield return dep;\r