Author: mlandres Date: Wed Apr 30 16:40:35 2008 New Revision: 9913 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9913&view=rev Log: - Add zypp.conf option solvfilesdir: Path where the repo solv files are created. Default value: {cachedir}/solv. - Target and repositories now save their solvfiles below {solvfilesdir} in directories named after the repositories alias. Modified: trunk/libzypp/devel/devel.ma/NewPool.cc trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp.conf trunk/libzypp/zypp/RepoManager.cc trunk/libzypp/zypp/RepoManager.h trunk/libzypp/zypp/ZConfig.cc trunk/libzypp/zypp/ZConfig.h trunk/libzypp/zypp/target/TargetImpl.cc Modified: trunk/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=9913&r1=9912&r2=9913&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/NewPool.cc (original) +++ trunk/libzypp/devel/devel.ma/NewPool.cc Wed Apr 30 16:40:35 2008 @@ -615,6 +615,10 @@ /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// + INT << "===[END]============================================" << endl << endl; + zypp::base::LogControl::instance().logNothing(); + return 0; //ResPool pool( ResPool::instance() ); // Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=9913&r1=9912&r2=9913&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Wed Apr 30 16:40:35 2008 @@ -1,4 +1,14 @@ ------------------------------------------------------------------- +Wed Apr 30 16:27:49 CEST 2008 - ma@suse.de + +- Add zypp.conf option solvfilesdir: Path where the repo solv files + are created. Default value: {cachedir}/solv. +- Target and repositories now save their solvfiles below {solvfilesdir} + in directories named after the repositories alias. +- version 4.18.0 +- revision 9913 + +------------------------------------------------------------------- Wed Apr 30 14:19:16 CEST 2008 - jkupec@suse.cz - fixed filesystem::expandlink(Pathname) (bnc #368477) Modified: trunk/libzypp/zypp.conf URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp.conf?rev=9913&r1=9912&r2=9913&view=diff ============================================================================== --- trunk/libzypp/zypp.conf (original) +++ trunk/libzypp/zypp.conf Wed Apr 30 16:40:35 2008 @@ -21,10 +21,19 @@ ## +## Path where the caches are kept. +## +## Valid values: A directory +## Default value: /var/cache/zypp +## +# cachedir = /var/cache/zypp + + +## ## Path where the repo metadata is downloaded and kept. ## ## Valid values: A directory -## Default value: /var/cache/zypp/raw +## Default value: {cachedir}/raw ## ## Changing this needs a full refresh (incl. download) of all repository data ## @@ -32,34 +41,32 @@ ## -## Path where the repo packages are downloaded and kept. +## Path where the repo solv files are created and kept. ## ## Valid values: A directory -## Default value: /var/cache/zypp/packages +## Default value: {cachedir}/solv ## -# packagesdir = /var/cache/zypp/packages +# solvfilesdir = /var/cache/zypp/solv ## -## Path where the known repositories .repo files are kept +## Path where the repo packages are downloaded and kept. ## ## Valid values: A directory -## Default value: /etc/zypp/repos.d +## Default value: {cachedir}/packages ## -## Changing this invalidates all known repositories -## -# reposdir = /etc/zypp/repos.d +# packagesdir = /var/cache/zypp/packages ## -## Path where the processed cache is kept (this is where zypp.db is located) +## Path where the known repositories .repo files are kept ## ## Valid values: A directory -## Default value: /var/cache/zypp +## Default value: /etc/zypp/repos.d ## -## Changing this needs a full refresh (except download) of all repository data +## Changing this invalidates all known repositories ## -# cachedir = /var/cache/zypp +# reposdir = /etc/zypp/repos.d ## @@ -125,7 +132,7 @@ # download.use_deltarpm = true -## +## ## Defining directory for equivalent vendors ## ## Valid values: A directory @@ -135,7 +142,7 @@ ## ## Whether required packages are installed ONLY -## So recommended packages, language packages and packages which depend +## So recommended packages, language packages and packages which depend ## on hardware (modalias) will not be regarded. ## ## Valid values: boolean @@ -152,7 +159,7 @@ ## # locksfile.path = /etc/zypp/locks -## +## ## Whetever to apply locks in locks file after zypp start. ## ## Valid values: boolean Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=9913&r1=9912&r2=9913&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Wed Apr 30 16:40:35 2008 @@ -66,11 +66,12 @@ RepoManagerOptions::RepoManagerOptions() { - repoCachePath = ZConfig::instance().repoCachePath(); - repoRawCachePath = ZConfig::instance().repoMetadataPath(); + repoCachePath = ZConfig::instance().repoCachePath(); + repoRawCachePath = ZConfig::instance().repoMetadataPath(); + repoSolvCachePath = ZConfig::instance().repoSolvfilesPath(); repoPackagesCachePath = ZConfig::instance().repoPackagesPath(); - knownReposPath = ZConfig::instance().knownReposPath(); - probe = ZConfig::instance().repo_add_probe(); + knownReposPath = ZConfig::instance().knownReposPath(); + probe = ZConfig::instance().repo_add_probe(); } //////////////////////////////////////////////////////////////////////////// @@ -206,7 +207,7 @@ static Pathname solv_path_for_repoinfo( const RepoManagerOptions &opt, const RepoInfo &info) { assert_alias(info); - return opt.repoCachePath / "solv" / info.escaped_alias(); + return opt.repoSolvCachePath / info.escaped_alias(); } /////////////////////////////////////////////////////////////////// @@ -603,7 +604,7 @@ ++it ) { Pathname cachepath(rawcache_path_for_repoinfo( _pimpl->options, *it )); - if ( PathInfo(cachepath).isExist() ) + if ( PathInfo(cachepath).isExist() ) downloader_ptr->addCachePath(cachepath); } @@ -885,12 +886,6 @@ progress.toMax(); } - void RepoManager::cleanTargetCache(const ProgressData::ReceiverFnc & progressrcv) - { - unlink (_pimpl->options.repoCachePath / (sat::Pool::systemRepoName() + ".solv")); - unlink (_pimpl->options.repoCachePath / (sat::Pool::systemRepoName() + ".cookie")); - } - //////////////////////////////////////////////////////////////////////////// bool RepoManager::isCached( const RepoInfo &info ) const Modified: trunk/libzypp/zypp/RepoManager.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.h?rev=9913&r1=9912&r2=9913&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.h (original) +++ trunk/libzypp/zypp/RepoManager.h Wed Apr 30 16:40:35 2008 @@ -51,6 +51,7 @@ Pathname repoCachePath; Pathname repoRawCachePath; + Pathname repoSolvCachePath; Pathname repoPackagesCachePath; Pathname knownReposPath; bool probe; @@ -162,7 +163,7 @@ * \param info * \param url * \param policy - * \return state of repository + * \return state of repository * \see RefreshCheckStatus * \throws RepoUnknownTypeException * \throws repo::RepoNoAliasException if can't figure an alias @@ -268,11 +269,6 @@ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() ); /** - * Clean target system (rpm db) cache. - */ - void cleanTargetCache(const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc()); - - /** * \short Whether a repository exists in cache * * \param RepoInfo to be checked. Modified: trunk/libzypp/zypp/ZConfig.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ZConfig.cc?rev=9913&r1=9912&r2=9913&view=diff ============================================================================== --- trunk/libzypp/zypp/ZConfig.cc (original) +++ trunk/libzypp/zypp/ZConfig.cc Wed Apr 30 16:40:35 2008 @@ -198,17 +198,25 @@ cfg_arch = carch; } } + else if ( entry == "cachedir" ) + { + cfg_cache_path = Pathname(value); + } else if ( entry == "metadatadir" ) { cfg_metadata_path = Pathname(value); } - else if ( entry == "reposdir" ) + else if ( entry == "solvfilesdir" ) { - cfg_known_repos_path = Pathname(value); + cfg_solvfiles_path = Pathname(value); } - else if ( entry == "cachedir" ) + else if ( entry == "packagesdir" ) { - cfg_cache_path = Pathname(value); + cfg_packages_path = Pathname(value); + } + else if ( entry == "reposdir" ) + { + cfg_known_repos_path = Pathname(value); } else if ( entry == "repo.add.probe" ) { @@ -230,10 +238,6 @@ { cfg_vendor_path = Pathname(value); } - else if ( entry == "packagesdir" ) - { - cfg_packages_path = Pathname(value); - } else if ( entry == "solver.onlyRequires" ) { solver_onlyRequires = str::strToBool( value, solver_onlyRequires ); @@ -283,6 +287,7 @@ Locale cfg_textLocale; Pathname cfg_metadata_path; + Pathname cfg_solvfiles_path; Pathname cfg_packages_path; Pathname cfg_cache_path; Pathname cfg_known_repos_path; @@ -389,24 +394,31 @@ /////////////////////////////////////////////////////////////////// + Pathname ZConfig::repoCachePath() const + { + return ( _pimpl->cfg_cache_path.empty() + ? Pathname("/var/cache/zypp") : _pimpl->cfg_cache_path ); + } + Pathname ZConfig::repoMetadataPath() const { return ( _pimpl->cfg_metadata_path.empty() - ? Pathname("/var/cache/zypp/raw") : _pimpl->cfg_metadata_path ); + ? (repoCachePath()/"raw") : _pimpl->cfg_metadata_path ); } - Pathname ZConfig::repoPackagesPath() const + Pathname ZConfig::repoSolvfilesPath() const { - return ( _pimpl->cfg_packages_path.empty() - ? Pathname("/var/cache/zypp/packages") : _pimpl->cfg_packages_path ); + return ( _pimpl->cfg_solvfiles_path.empty() + ? (repoCachePath()/"solv") : _pimpl->cfg_solvfiles_path ); } - Pathname ZConfig::repoCachePath() const + Pathname ZConfig::repoPackagesPath() const { - return ( _pimpl->cfg_cache_path.empty() - ? Pathname("/var/cache/zypp") : _pimpl->cfg_cache_path ); + return ( _pimpl->cfg_packages_path.empty() + ? (repoCachePath()/"packages") : _pimpl->cfg_packages_path ); } + Pathname ZConfig::knownReposPath() const { return ( _pimpl->cfg_known_repos_path.empty() Modified: trunk/libzypp/zypp/ZConfig.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ZConfig.h?rev=9913&r1=9912&r2=9913&view=diff ============================================================================== --- trunk/libzypp/zypp/ZConfig.h (original) +++ trunk/libzypp/zypp/ZConfig.h Wed Apr 30 16:40:35 2008 @@ -83,21 +83,25 @@ { setTextLocale( defaultTextLocale() ); } public: + /** + * Path where the caches are kept. + */ + Pathname repoCachePath() const; + /** * Path where the repo metadata is downloaded and kept. */ Pathname repoMetadataPath() const; - /** - * Path where the repo packages are downloaded and kept. + /** + * Path where the repo solv files are created and kept. */ - Pathname repoPackagesPath() const; + Pathname repoSolvfilesPath() const; /** - * Path where the processed cache is kept - * (this is where zypp.db is located. + * Path where the repo packages are downloaded and kept. */ - Pathname repoCachePath() const; + Pathname repoPackagesPath() const; /** * Path where the known repositories @@ -140,7 +144,7 @@ /** * Solver regards required packages,patterns,... only - */ + */ bool solver_onlyRequires() const; /** Modified: trunk/libzypp/zypp/target/TargetImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=9913&r1=9912&r2=9913&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.cc (original) +++ trunk/libzypp/zypp/target/TargetImpl.cc Wed Apr 30 16:40:35 2008 @@ -303,17 +303,16 @@ void TargetImpl::clearCache() { Pathname base = Pathname::assertprefix( _root, - ZConfig::instance().repoCachePath() / sat::Pool::instance().systemRepoName() ); - filesystem::unlink( base.extend(".solv") ); - filesystem::unlink( base.extend(".cookie") ); + ZConfig::instance().repoSolvfilesPath() / sat::Pool::instance().systemRepoName() ); + filesystem::recursive_rmdir( base ); } void TargetImpl::buildCache() { Pathname base = Pathname::assertprefix( _root, - ZConfig::instance().repoCachePath() / sat::Pool::instance().systemRepoName() ); - Pathname rpmsolv = base.extend(".solv"); - Pathname rpmsolvcookie = base.extend(".cookie"); + ZConfig::instance().repoSolvfilesPath() / sat::Pool::instance().systemRepoName() ); + Pathname rpmsolv = base/"solv"; + Pathname rpmsolvcookie = base/"cookie"; bool build_rpm_solv = true; // lets see if the rpm solv cache exists @@ -339,27 +338,22 @@ if ( build_rpm_solv ) { // Take care we unlink the solvfile on exception - ManagedFile guard( rpmsolv, filesystem::unlink ); - ManagedFile guardcookie( rpmsolvcookie, filesystem::unlink ); - - filesystem::Pathname cachePath = Pathname::assertprefix( _root, ZConfig::instance().repoCachePath() ); + ManagedFile guard( base, filesystem::recursive_rmdir ); // if it does not exist yet, we better create it - filesystem::assert_dir( cachePath ); + filesystem::assert_dir( base ); - filesystem::TmpFile tmpsolv( cachePath /*dir*/, - sat::Pool::instance().systemRepoName() /* prefix */ ); + filesystem::TmpFile tmpsolv( filesystem::TmpFile::makeSibling( rpmsolv ) ); if (!tmpsolv) { Exception ex("Failed to cache rpm database."); ex.remember(str::form( - "Cannot create temporary file under %s.", cachePath.asString().c_str())); + "Cannot create temporary file under %s.", base.c_str())); ZYPP_THROW(ex); } ostringstream cmd; cmd << "rpmdb2solv"; - if ( ! _root.empty() ) cmd << " -r '" << _root << "'"; #warning DIFF TO EXISTING SOLV FILE DISABLED @@ -399,7 +393,6 @@ // We keep it. guard.resetDispose(); - guardcookie.resetDispose(); } } @@ -417,11 +410,22 @@ // now add the repos to the pool sat::Pool satpool( sat::Pool::instance() ); - Repository system( satpool.systemRepo() ); - Pathname rpmsolv( Pathname::assertprefix( _root, ZConfig::instance().repoCachePath() + system.name() ).extend(".solv") ); - MIL << "adding " << rpmsolv << " to pool(" << system.name() << ")" << endl; + Pathname rpmsolv( Pathname::assertprefix( _root, + ZConfig::instance().repoSolvfilesPath() / satpool.systemRepoName() / "solv" ) ); + MIL << "adding " << rpmsolv << " to pool(" << satpool.systemRepoName() << ")" << endl; #warning PROBABLY CLEAR NONEMTY SYSTEM REPO + // Providing an empty system repo, unload any old content + Repository system( sat::Pool::instance().findSystemRepo() ); + if ( system && ! system.solvablesEmpty() ) + { + system.eraseFromPool(); // invalidates system + } + if ( ! system ) + { + system = satpool.systemRepo(); + } + try { system.addSolv( rpmsolv ); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org