Author: dmacvicar Date: Thu Mar 13 13:56:52 2008 New Revision: 9122 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9122&view=rev Log: - add cache path only if it exists - make log line in fetcher better Modified: trunk/libzypp/zypp/Fetcher.cc trunk/libzypp/zypp/RepoManager.cc Modified: trunk/libzypp/zypp/Fetcher.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Fetcher.cc?rev=9122&r1=9121&r2=9122&view=diff ============================================================================== --- trunk/libzypp/zypp/Fetcher.cc (original) +++ trunk/libzypp/zypp/Fetcher.cc Thu Mar 13 13:56:52 2008 @@ -117,16 +117,24 @@ void Fetcher::Impl::addCachePath( const Pathname &cache_dir ) { PathInfo info(cache_dir); - if ( info.isDir() ) + if ( info.isExist() ) { - DBG << "Adding fetcher cache: '" << cache_dir << "'." << endl; - _caches.push_back(cache_dir); + if ( info.isDir() ) + { + DBG << "Adding fetcher cache: '" << cache_dir << "'." << endl; + _caches.push_back(cache_dir); + } + else + { + // don't add bad cache directory, just log the error + ERR << "Not adding cache: '" << cache_dir << "'. Not a directory." << endl; + } } else { - // don't add bad cache directory, just log the error - ERR << "Not adding cache: '" << cache_dir << "'. Not a directory." << endl; + ERR << "Not adding cache '" << cache_dir << "'. Path does not exists." << endl; } + } void Fetcher::Impl::start( const Pathname &dest_dir, Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=9122&r1=9121&r2=9122&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Thu Mar 13 13:56:52 2008 @@ -579,7 +579,9 @@ it != repos.end(); ++it ) { - downloader_ptr->addCachePath(rawcache_path_for_repoinfo( _pimpl->options, *it )); + Pathname cachepath(rawcache_path_for_repoinfo( _pimpl->options, *it )); + if ( PathInfo(cachepath).isExist() ) + downloader_ptr->addCachePath(cachepath); } downloader_ptr->download( media, tmpdir.path()); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org