ExportFeeds() 공개 메소드

Exports all feeds listed in a Selections document along with any OpenPGP public key files required for validation.
The file could not be read or written. Write access to the directory is not permitted. A feed or GnuPG could not be read from the cache.
public ExportFeeds ( [ feedCache, [ openPgp ) : void
feedCache [ Used to get local feed files.
openPgp [ Used to get export keys feeds were signed with.
리턴 void
예제 #1
0
        public void TestExportFeeds()
        {
            using (var feedFile1 = new TemporaryFile("0install-unit-tests"))
                using (var feedFile2 = new TemporaryFile("0install-unit-tests"))
                {
                    var feedCacheMock = CreateMock <IFeedCache>();

                    feedCacheMock.Setup(x => x.GetPath(FeedTest.Sub1Uri)).Returns(feedFile1);
                    feedCacheMock.Setup(x => x.GetPath(FeedTest.Sub2Uri)).Returns(feedFile2);

                    var signature = new ValidSignature(123, new byte[0], new DateTime(2000, 1, 1));
                    feedCacheMock.Setup(x => x.GetSignatures(FeedTest.Sub1Uri)).Returns(new OpenPgpSignature[] { signature });
                    feedCacheMock.Setup(x => x.GetSignatures(FeedTest.Sub2Uri)).Returns(new OpenPgpSignature[] { signature });

                    var openPgpMock = CreateMock <IOpenPgp>();
                    openPgpMock.Setup(x => x.ExportKey(signature)).Returns("abc");

                    _target.ExportFeeds(feedCacheMock.Object, openPgpMock.Object);

                    string contentDir = Path.Combine(_destination, "content");
                    FileAssert.AreEqual(
                        expected: new FileInfo(feedFile1),
                        actual: new FileInfo(Path.Combine(contentDir, FeedTest.Sub1Uri.PrettyEscape())),
                        message: "Feed should be exported.");
                    FileAssert.AreEqual(
                        expected: new FileInfo(feedFile2),
                        actual: new FileInfo(Path.Combine(contentDir, FeedTest.Sub2Uri.PrettyEscape())),
                        message: "Feed should be exported.");

                    File.ReadAllText(Path.Combine(contentDir, "000000000000007B.gpg")).Should()
                    .Be("abc", because: "GPG keys should be exported.");
                }
        }
예제 #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();
        }
예제 #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();
        }