Author: dmacvicar Date: Fri Jul 20 22:21:08 2007 New Revision: 6134 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6134&view=rev Log: add methods to retrieve the status (checksum, date) of metadata and cache Modified: trunk/libzypp/zypp/RepoManager.cc trunk/libzypp/zypp/RepoManager.h Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=6134&r1=6133&r2=6134&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Fri Jul 20 22:21:08 2007 @@ -262,7 +262,7 @@ //////////////////////////////////////////////////////////////////////////// - RepoStatus RepoManager::rawMetadataStatus( const RepoInfo &info ) + RepoStatus RepoManager::metadataStatus( const RepoInfo &info ) const { Pathname rawpath = rawcache_path_for_repoinfo( _pimpl->options, info ); RepoType repokind = info.type(); @@ -339,7 +339,7 @@ } Pathname rawpath = rawcache_path_for_repoinfo( _pimpl->options, info ); - oldstatus = rawMetadataStatus(info); + oldstatus = metadataStatus(info); if ( ( repokind.toEnum() == RepoType::RPMMD_e ) || ( repokind.toEnum() == RepoType::YAST2_e ) ) @@ -468,7 +468,7 @@ cache::CacheStore store(_pimpl->options.repoCachePath); - RepoStatus raw_metadata_status = rawMetadataStatus(info); + RepoStatus raw_metadata_status = metadataStatus(info); if ( raw_metadata_status.empty() ) { ZYPP_THROW(RepoMetadataException(info)); @@ -553,7 +553,7 @@ //////////////////////////////////////////////////////////////////////////// - repo::RepoType RepoManager::probe( const Url &url ) + repo::RepoType RepoManager::probe( const Url &url ) const { if ( url.getScheme() == "dir" && ! PathInfo( url.getPathName() ).isDir() ) { @@ -608,6 +608,14 @@ return store.isCached(info.alias()); } + RepoStatus RepoManager::cacheStatus( const RepoInfo &info ) const + { + cache::CacheStore store(_pimpl->options.repoCachePath); + data::RecordId id = store.lookupRepository(info.alias()); + RepoStatus cache_status = store.repositoryStatus(id); + return cache_status; + } + Repository RepoManager::createFromCache( const RepoInfo &info, const ProgressData::ReceiverFnc & progressrcv ) { Modified: trunk/libzypp/zypp/RepoManager.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.h?rev=6134&r1=6133&r2=6134&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.h (original) +++ trunk/libzypp/zypp/RepoManager.h Fri Jul 20 22:21:08 2007 @@ -102,6 +102,11 @@ std::list<RepoInfo> knownRepositories() const; /** + * \short Status of local metadata + */ + RepoStatus metadataStatus( const RepoInfo &info ) const; + + /** * \short Refresh local raw cache * * Will try to download the metadata @@ -128,6 +133,11 @@ */ void cleanMetadata( const RepoInfo &info, const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() ); + + /** + * \short Status of metadata cache + */ + RepoStatus cacheStatus( const RepoInfo &info ) const; /** * \short Refresh local cache @@ -200,7 +210,7 @@ * * \todo FIXME Should this be private? */ - repo::RepoType probe( const Url &url ); + repo::RepoType probe( const Url &url ) const; /** -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org