private void installMetaPackage(PackageFetcher.FetchedPackage source) { var package = MetaPackage.Read(source.Package); if (package == null) { _dispatch("error|Invalid meta package"); return; } foreach (var pckg in package.Packages) { string[] versions = null; if (pckg.Version != null) { versions = new[] { pckg.Version } } ; install(pckg.Id, versions); } if (source.IsTemporaryPackage) { File.Delete(source.Package); } }
public void Can_read_meta_package() { var package = new MetaPackage((file) => { return getPackage(); }, "/some/file" ); Assert.That(package.File, Is.EqualTo("/some/file")); Assert.That(package.OS[0], Is.EqualTo("linux")); Assert.That(package.OS[1], Is.EqualTo("osx")); Assert.That(package.Id, Is.EqualTo("pack")); Assert.That(package.Version, Is.EqualTo("v1.0")); Assert.That(package.Name, Is.EqualTo("Pack")); Assert.That(package.Description, Is.EqualTo("Pack desc")); Assert.That(package.Packages[0].Id, Is.EqualTo("package1")); Assert.That(package.Packages[0].Version, Is.EqualTo("v1.0")); Assert.That(package.Packages[1].Id, Is.EqualTo("package2")); Assert.That(package.Packages[1].Version, Is.Null); }