Author: dmacvicar Date: Wed Jan 16 17:58:28 2008 New Revision: 8307 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8307&view=rev Log: - more progress creating caches Modified: branches/tmp/ma/jump_sat/libzypp/tests/zypp/RepoManager_test.cc branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc Modified: branches/tmp/ma/jump_sat/libzypp/tests/zypp/RepoManager_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/tests/zypp/RepoManager_test.cc?rev=8307&r1=8306&r2=8307&view=diff ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/tests/zypp/RepoManager_test.cc (original) +++ branches/tmp/ma/jump_sat/libzypp/tests/zypp/RepoManager_test.cc Wed Jan 16 17:58:28 2008 @@ -85,19 +85,35 @@ // the file should not exist anymore BOOST_CHECK( ! PathInfo(tmpKnownReposPath.path() + "/proprietary.repo_1").isExist() ); - // for now skip creation - return; - - RepoInfo repo(repos.front()); - // we have no metadata yet so this should throw - BOOST_CHECK_THROW( manager.buildCache(repo), - RepoMetadataException ); + // let test cache creation + + RepoInfo repo; + repo.setAlias("foo"); + //Url repourl("dir:" + string(TESTS_SRC_DIR) + "/repo/yum/data/10.2-updates-subset"); + Url repourl("dir:/mounts/dist/install/stable-x86/suse"); + //BOOST_CHECK_MESSAGE(0, repourl.asString()); + repo.setBaseUrl(repourl); + + KeyRingTestReceiver keyring_callbacks; + KeyRingTestSignalReceiver receiver; + + // disable sgnature checking + keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptVerFailed(true); + keyring_callbacks.answerAcceptUnknownKey(true); manager.refreshMetadata(repo); BOOST_CHECK_MESSAGE( ! manager.isCached(repo), "Repo is not yet cached" ); + manager.buildCache(repo); + + // we have no metadata yet so this should throw + //BOOST_CHECK_THROW( manager.buildCache(repo), + // RepoMetadataException ); + + return; Repository repository; @@ -107,9 +123,14 @@ MIL << "repo " << repo.alias() << " not cached yet. Caching..." << endl; manager.buildCache(repo); + + // the solv file should exists now + Pathname solvfile = (opts.repoCachePath + repo.alias()).extend(".solv"); + BOOST_CHECK_MESSAGE( !PathInfo(solvfile).isExist(), "Solv file is created after caching"); + repository = manager.createFromCache(repo); - BOOST_CHECK_MESSAGE( manager.isCached(repo), + BOOST_CHECK_MESSAGE( manager.isCached(repo), "Repo is cached" ); ResStore store = repository.resolvables(); Modified: branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc?rev=8307&r1=8306&r2=8307&view=diff ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc (original) +++ branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc Wed Jan 16 17:58:28 2008 @@ -865,7 +865,7 @@ { Pathname name = _pimpl->options.repoCachePath; RepoStatus status; - Pathname base = _pimpl->options.repoCachePath + name + Pathname(info.alias()); + Pathname base = _pimpl->options.repoCachePath + Pathname(info.alias()); Pathname solvfile = base.extend(".solv"); Pathname cookiefile = base.extend(".cookie"); @@ -890,7 +890,7 @@ void RepoManager::setCacheStatus( const string &alias, const RepoStatus &status ) { - Pathname base = _pimpl->options.repoCachePath + alias + Pathname(alias); + Pathname base = _pimpl->options.repoCachePath + alias; Pathname cookiefile = base.extend(".cookie"); std::ofstream file(cookiefile.c_str()); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org