From c0c176d43e14262c5b13c4daf53e97ab6636e55e Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 1 Nov 2016 11:06:00 +0900 Subject: [PATCH] Imported Upstream version 15.17.1 Change-Id: If2ec37ea8ef3d72aedc8329f0c97f3c1137efaaa Signed-off-by: DongHun Kwak --- VERSION.cmake | 4 ++-- package/libzypp.changes | 7 +++++++ zypp/Pattern.cc | 8 +++++++- zypp/RepoManager.cc | 36 +++++++++++++++++++++++++++++++++--- 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 92650c8..3b209d9 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "15") SET(LIBZYPP_COMPATMINOR "14") SET(LIBZYPP_MINOR "17") -SET(LIBZYPP_PATCH "0") +SET(LIBZYPP_PATCH "1") # -# LAST RELEASED: 15.17.0 (14) +# LAST RELEASED: 15.17.1 (14) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index 0b21cfa..a86c59b 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri Sep 25 11:42:28 CEST 2015 - ma@suse.de + +- Pattern: support dynamic computation of pattern visibility (bsc#900769) +- Avoid URL rewrite if probing local cache directories (bsc#946129) +- version 15.17.1 (14) + +------------------------------------------------------------------- Mon Sep 21 16:57:45 CEST 2015 - ma@suse.de - Dummy (FATE#318827) to make Sles-changelog-checker stop whining. diff --git a/zypp/Pattern.cc b/zypp/Pattern.cc index 45562f0..99c83a0 100644 --- a/zypp/Pattern.cc +++ b/zypp/Pattern.cc @@ -181,7 +181,13 @@ namespace zypp { return lookupBoolAttribute( sat::SolvAttr::isdefault ); } bool Pattern::userVisible() const - { return lookupBoolAttribute( sat::SolvAttr::isvisible ); } + { + // bsc#900769: If visibility is a string(solvable ident) the pattern + // is visible IFF ident is available in the pool. + IdString ident( lookupStrAttribute( sat::SolvAttr::isvisible ) ); + return( ident.empty() ? lookupBoolAttribute( sat::SolvAttr::isvisible ) + : ! ResPool::instance().byIdent( ident ).empty() ); + } std::string Pattern::category( const Locale & lang_r ) const { return lookupStrAttribute( sat::SolvAttr::category, lang_r ); } diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index 40c9eeb..2317a8d 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -520,6 +520,7 @@ namespace zypp void buildCache( const RepoInfo & info, CacheBuildPolicy policy, OPT_PROGRESS ); repo::RepoType probe( const Url & url, const Pathname & path = Pathname() ) const; + repo::RepoType probeCache( const Pathname & path_r ) const; void cleanCacheDirGarbage( OPT_PROGRESS ); @@ -812,7 +813,7 @@ namespace zypp RepoType repokind = info.type(); // If unknown, probe the local metadata if ( repokind == RepoType::NONE ) - repokind = probe( productdatapath.asUrl() ); + repokind = probeCache( productdatapath ); RepoStatus status; switch ( repokind.toEnum() ) @@ -846,7 +847,7 @@ namespace zypp RepoType repokind = info.type(); if ( repokind.toEnum() == RepoType::NONE_e ) // unknown, probe the local metadata - repokind = probe( productdatapath.asUrl() ); + repokind = probeCache( productdatapath ); // if still unknown, just return if (repokind == RepoType::NONE_e) return; @@ -1241,7 +1242,7 @@ namespace zypp { case RepoType::NONE_e: // unknown, probe the local metadata - repokind = probe( productdatapath.asUrl() ); + repokind = probeCache( productdatapath ); break; default: break; @@ -1314,6 +1315,13 @@ namespace zypp //////////////////////////////////////////////////////////////////////////// + + /** Probe the metadata type of a repository located at \c url. + * Urls here may be rewritten by \ref MediaSetAccess to reflect the correct media number. + * + * \note Metadata in local cache directories must be probed using \ref probeCache as + * a cache path must not be rewritten (bnc#946129) + */ repo::RepoType RepoManager::Impl::probe( const Url & url, const Pathname & path ) const { MIL << "going to probe the repo type at " << url << " (" << path << ")" << endl; @@ -1398,6 +1406,28 @@ namespace zypp return repo::RepoType::NONE; } + /** Probe Metadata in a local cache directory + * + * \note Metadata in local cache directories must not be probed using \ref probe as + * a cache path must not be rewritten (bnc#946129) + */ + repo::RepoType RepoManager::Impl::probeCache( const Pathname & path_r ) const + { + MIL << "going to probe the cached repo at " << path_r << endl; + + repo::RepoType ret = repo::RepoType::NONE; + + if ( PathInfo(path_r/"/repodata/repomd.xml").isFile() ) + { ret = repo::RepoType::RPMMD; } + else if ( PathInfo(path_r/"/content").isFile() ) + { ret = repo::RepoType::YAST2; } + else if ( PathInfo(path_r).isDir() ) + { ret = repo::RepoType::RPMPLAINDIR; } + + MIL << "Probed cached type " << ret << " at " << path_r << endl; + return ret; + } + //////////////////////////////////////////////////////////////////////////// void RepoManager::Impl::cleanCacheDirGarbage( const ProgressData::ReceiverFnc & progressrcv ) -- 2.7.4