Author: jreidinger Date: Thu Mar 20 14:57:20 2008 New Revision: 9231 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9231&view=rev Log: return more information from checking if metadata need refresh, so user can get better info. (bnc #307249) Modified: trunk/libzypp/VERSION.cmake trunk/libzypp/zypp/RepoManager.cc trunk/libzypp/zypp/RepoManager.h Modified: trunk/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=9231&r1=9230&r2=9231&view=diff ============================================================================== --- trunk/libzypp/VERSION.cmake (original) +++ trunk/libzypp/VERSION.cmake Thu Mar 20 14:57:20 2008 @@ -45,6 +45,6 @@ # SET(LIBZYPP_MAJOR "4") -SET(LIBZYPP_MINOR "5") -SET(LIBZYPP_COMPATMINOR "5") +SET(LIBZYPP_MINOR "6") +SET(LIBZYPP_COMPATMINOR "6") SET(LIBZYPP_PATCH "0") Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=9231&r1=9230&r2=9231&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Thu Mar 20 14:57:20 2008 @@ -386,7 +386,8 @@ filesystem::touch(p); } - bool RepoManager::checkIfToRefreshMetadata( const RepoInfo &info, + RepoManager::RefreshCheckStatus RepoManager::checkIfToRefreshMetadata( + const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy ) { @@ -434,7 +435,7 @@ << "' has been refreshed less than repo.refresh.delay (" << ZConfig::instance().repo_refresh_delay() << ") minutes ago. Advising to skip refresh" << endl; - return false; + return REPO_DELAYED; } } @@ -472,7 +473,7 @@ if (!refresh) touchIndexFile(info); - return refresh; + return refresh ? REFRESH_NEEDED : REPO_UP_TO_DATE; } #if 0 else if ( repokind.toEnum() == RepoType::RPMPLAINDIR_e ) @@ -512,7 +513,7 @@ ZYPP_RETHROW(e); } - return true; // default + return REFRESH_NEEDED; // default } void RepoManager::refreshMetadata( const RepoInfo &info, @@ -534,7 +535,7 @@ // check whether to refresh metadata // if the check fails for this url, it throws, so another url will be checked - if (!checkIfToRefreshMetadata(info, url, policy)) + if (checkIfToRefreshMetadata(info, url, policy)!=REFRESH_NEEDED) return; MIL << "Going to refresh metadata from " << url << endl; Modified: trunk/libzypp/zypp/RepoManager.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.h?rev=9231&r1=9230&r2=9231&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.h (original) +++ trunk/libzypp/zypp/RepoManager.h Thu Mar 20 14:57:20 2008 @@ -106,6 +106,15 @@ RepoStatus metadataStatus( const RepoInfo &info ) const; /** + * Possibly return state of checkIfRefreshMEtadata function + */ + enum RefreshCheckStatus { + REFRESH_NEEDED, /**< refresh is needed */ + REPO_UP_TO_DATE, /**< repository not changed */ + REPO_DELAYED /**< refresh is delayed due to settings */ + }; + + /** * Checks whether to refresh metadata for specified repository and url. * <p> * The need for refresh is evaluated according to the following conditions, @@ -133,7 +142,7 @@ * { * // check whether to refresh metadata * // if the check fails for this url, it throws, so another url will be checked - * if (!checkIfToRefreshMetadata(info, *it, policy)) + * if (checkIfToRefreshMetadata(info, *it, policy)!=RepoInfo::REFRESH_NEEDED) * return; * * // do the actual refresh @@ -152,12 +161,14 @@ * \param info * \param url * \param policy + * \return state of repository + * \see RefreshCheckStatus * \throws RepoUnknownTypeException * \throws repo::RepoNoAliasException if can't figure an alias * \throws Exception on unknown error * */ - bool checkIfToRefreshMetadata( const RepoInfo &info, + RefreshCheckStatus checkIfToRefreshMetadata( const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy = RefreshIfNeeded); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org