ExportImplementations() public method

Exports all implementations listed in a Selections document as archives.
The user canceled the task. The file could not be read or written. Write access to the directory is not permitted. An implementation archive could not be creates.
public ExportImplementations ( [ store, [ handler ) : void
store [ Used to get cached implementations.
handler [ A callback object used when the the user needs to be asked questions or informed about download and IO tasks.
return void
Example #1
0
        public void TestExportImplementations()
        {
            using (var implDir1 = new TemporaryDirectory("0install-unit-tests"))
                using (var implDir2 = new TemporaryDirectory("0install-unit-tests"))
                {
                    var storeMock = CreateMock <IStore>();
                    storeMock.Setup(x => x.GetPath(new ManifestDigest(null, null, "123", null))).Returns(implDir1);
                    storeMock.Setup(x => x.GetPath(new ManifestDigest(null, null, "abc", null))).Returns(implDir2);

                    _target.ExportImplementations(storeMock.Object, new SilentTaskHandler());
                }

            string contentDir = Path.Combine(_destination, "content");

            File.Exists(Path.Combine(contentDir, "sha256=123.tbz2")).Should()
            .BeTrue(because: "Implementation should be exported.");
            File.Exists(Path.Combine(contentDir, "sha256=abc.tbz2")).Should()
            .BeTrue(because: "Implementation should be exported.");
        }
Example #2
0
        public void DownloadPackage(string fastPackageReference, string location)
        {
            var requirements = ParseReference(fastPackageReference);
            var selections = Solve(requirements);
            Fetcher.Fetch(SelectionsManager.GetUncachedImplementations(selections));

            var exporter = new Exporter(selections, requirements, location);
            exporter.ExportFeeds(FeedCache, OpenPgp);
            exporter.ExportImplementations(Store, Handler);
            exporter.DeployImportScript();
            exporter.DeployBootstrapIntegrate(Handler);

            Yield(requirements);

            SelfUpdateCheck();
        }
Example #3
0
        /// <inheritdoc/>
        public override ExitCode Execute()
        {
            Solve();

            var exporter = new Exporter(Selections, Requirements, _outputPath);

            exporter.ExportFeeds(FeedCache, OpenPgp);
            if (!_noImplementations)
            {
                DownloadUncachedImplementations();
                exporter.ExportImplementations(Store, Handler);
            }

            exporter.DeployImportScript();
            switch (_bootstrapType)
            {
                case BootstrapMode.Run:
                    exporter.DeployBootstrapRun(Handler);
                    break;
                case BootstrapMode.Integrate:
                    exporter.DeployBootstrapIntegrate(Handler);
                    break;
            }

            SelfUpdateCheck();

            return ShowOutput();
        }