From c8cca6f27ea572f2cc91863925f188bc04513604 Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Mon, 24 Sep 2007 14:15:00 +0000 Subject: [PATCH] - Provide an api to get the metadata path. Needed to fix #293428 --- VERSION.cmake | 4 ++-- package/libzypp.changes | 10 ++++++++++ zypp/RepoManager.cc | 7 +++++++ zypp/RepoManager.h | 13 +++++++++++++ zypp/repo/RepoProvideFile.cc | 7 ++++--- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 92451dc..41d8e4c 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -45,6 +45,6 @@ # SET(LIBZYPP_MAJOR "3") -SET(LIBZYPP_MINOR "24") +SET(LIBZYPP_MINOR "25") SET(LIBZYPP_COMPATMINOR "24") -SET(LIBZYPP_PATCH "8") +SET(LIBZYPP_PATCH "0") diff --git a/package/libzypp.changes b/package/libzypp.changes index e0673df..fcba5fb 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,14 @@ ------------------------------------------------------------------- +Mon Sep 24 16:10:32 CEST 2007 - dmacvicar@suse.de + +- provide a way to retrieve the metadata path. Used for + installation, which incorrectly creates a repository in + cache without adding it first, so metadata path is not + set and therefore it is not possible to setup a media + verifier on installation. Part of fix for (#293428) +- 3.25.0 + +------------------------------------------------------------------- Mon Sep 24 15:48:47 CEST 2007 - schubi@suse.de - If more than one resolvables provide a requirements and have different diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index 2568e00..b6de5a8 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -301,6 +301,13 @@ namespace zypp //////////////////////////////////////////////////////////////////////////// + Pathname RepoManager::metadataPath( const RepoInfo &info ) const + { + return rawcache_path_for_repoinfo(_pimpl->options, info ); + } + + //////////////////////////////////////////////////////////////////////////// + RepoStatus RepoManager::metadataStatus( const RepoInfo &info ) const { Pathname rawpath = rawcache_path_for_repoinfo( _pimpl->options, info ); diff --git a/zypp/RepoManager.h b/zypp/RepoManager.h index e7ca0d1..6708698 100644 --- a/zypp/RepoManager.h +++ b/zypp/RepoManager.h @@ -161,6 +161,19 @@ namespace zypp bool checkIfToRefreshMetadata( const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy = RefreshIfNeeded); + + /** + * \short Path where the metadata is downloaded and kept + * + * Given a repoinfo, tells where \ref RepoManager will download + * and keep the raw metadata. + * + * \param info Repository information + * + * \throws repo::RepoNoAliasException if can't figure an alias + */ + Pathname metadataPath( const RepoInfo &info ) const; + /** * \short Refresh local raw cache * diff --git a/zypp/repo/RepoProvideFile.cc b/zypp/repo/RepoProvideFile.cc index acb2902..44e3a6f 100644 --- a/zypp/repo/RepoProvideFile.cc +++ b/zypp/repo/RepoProvideFile.cc @@ -115,8 +115,9 @@ namespace zypp { RepoInfo info = repo.info(); // set a verifier if the repository has it + Pathname mediafile = info.metadataPath() + "/media.1/media"; - if ( ! mediafile.empty() ) + if ( ! info.metadataPath().empty() ) { if ( PathInfo(mediafile).isExist() ) { @@ -159,12 +160,12 @@ namespace zypp } else { - WAR << "No media verifier for repo '" << info.alias() << "'" << endl; + WAR << "No media verifier for repo '" << info.alias() << "' media/media.1 does not exist in '" << info.metadataPath() << "'" << endl; } } else { - MIL << "Unknown metadata path for repo '" << info.alias() << "'. Can't set media verifier."<< endl; + WAR << "'" << info.alias() << "' metadata path is empty. Can't set verifier. Probably this repository does not come from RepoManager." << endl; } } -- 2.7.4