示例#1
0
        public void DownloadPackage([NotNull] string fastPackageReference, [NotNull] string location)
        {
            Directory.CreateDirectory(location);
            typeof(OneGetCommand).WriteEmbeddedFile("import.bat", Path.Combine(location, "import.bat"));

            FeedCache           = new DiskFeedCache(Path.Combine(location, "interfaces"), OpenPgp);
            Store               = new DirectoryStore(Path.Combine(location, "implementations"), useWriteProtection: false);
            FeedManager.Refresh = true;

            var requirements = ParseReference(fastPackageReference);
            var selections   = Solve(requirements);

            Fetcher.Fetch(SelectionsManager.GetUncachedImplementations(selections));

            SelfUpdateCheck();
        }
示例#2
0
        public DiskFeedCacheTest()
        {
            // Create a temporary cache
            _tempDir = new TemporaryDirectory("0install-unit-tests");
            _cache   = new DiskFeedCache(_tempDir, new Mock <IOpenPgp>().Object);

            // Add some dummy feeds to the cache
            _feed1     = FeedTest.CreateTestFeed();
            _feed1.Uri = FeedTest.Test1Uri;
            _feed1.SaveXml(Path.Combine(_tempDir, _feed1.Uri.Escape()));

            var feed2 = FeedTest.CreateTestFeed();

            feed2.Uri = FeedTest.Test2Uri;
            feed2.SaveXml(Path.Combine(_tempDir, feed2.Uri.Escape()));
            File.WriteAllText(Path.Combine(_tempDir, "http_invalid"), "");
        }
        public override void SetUp()
        {
            base.SetUp();

            // Create a temporary cache
            _tempDir = new TemporaryDirectory("0install-unit-tests");
            _cache   = new DiskFeedCache(_tempDir, MockRepository.Create <IOpenPgp>().Object);

            // Add some dummy feeds to the cache
            _feed1     = FeedTest.CreateTestFeed();
            _feed1.Uri = FeedTest.Test1Uri;
            _feed1.SaveXml(Path.Combine(_tempDir, _feed1.Uri.Escape()));
            _feed1.Normalize(_feed1.Uri);
            _feed2     = FeedTest.CreateTestFeed();
            _feed2.Uri = FeedTest.Test2Uri;
            _feed2.SaveXml(Path.Combine(_tempDir, _feed2.Uri.Escape()));
            _feed2.Normalize(_feed2.Uri);
            File.WriteAllText(Path.Combine(_tempDir, "http_invalid"), "");
        }