{ 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 ); }
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 );
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() )
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;
{
case RepoType::NONE_e:
// unknown, probe the local metadata
- repokind = probe( productdatapath.asUrl() );
+ repokind = probeCache( productdatapath );
break;
default:
break;
////////////////////////////////////////////////////////////////////////////
+
+ /** 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;
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 )