13#include <zypp/base/LogTools.h>
27 inline Capability autoCapability(
const Capabilities & provides_r )
29 static const Capability autopattern(
"autopattern()" );
30 for (
const auto & cap : provides_r )
49 typedef std::map<Pattern::constPtr, DefaultIntegral<bool, false> > PatternMap;
51 typedef PatternMap::key_type value_type;
69 expandIncludes( unprocessed );
70 expandExtending( unprocessed );
73 }
while( (unprocessed = nextUnprocessed()) );
79 const_iterator begin()
const
82 const_iterator end()
const
102 for_( it, c.begin(), c.end() )
104 expandInclude( Capability( it->c_str() ) );
109 void expandInclude(
const Capability & include_r )
111 sat::WhatProvides w( include_r );
112 for_( it, w.begin(), w.end() )
123 for_( it, pool.byKindBegin<Pattern>(), pool.byKindEnd<Pattern>() )
125 expandIfExtends( pat_r, *it );
130 void expandIfExtends(
const Pattern::constPtr & pat_r,
const PoolItem & extending_r )
134 for_( it, c.begin(), c.end() )
136 if ( providedBy( pat_r, Capability( it->c_str() ) ) )
151 sat::Solvable pat( pat_r->satSolvable() );
152 sat::WhatProvides w( extends_r );
153 for_( it, w.begin(), w.end() )
234 caps_r.insert( c.begin(),c.end() );
266 if ( includeSuggests_r )
274 if ( includeSuggests_r )
286 PatternExpander expander;
287 if ( ! expander.doExpand(
this ) )
291 for_( it, expander.begin(), expander.end() )
293 Contents c( (*it)->depends( includeSuggests_r ) );
306 addCaps( caps, depKeeper_r, dep_r );
310 const PoolItem & pi( sel->theObj() );
317 inline void dependsSet( sat::Solvable depKeeper_r, Pattern::ContentsSet & collect_r )
319 dependsSetDoCollect( depKeeper_r,
Dep::REQUIRES, collect_r.req );
321 dependsSetDoCollect( depKeeper_r,
Dep::SUGGESTS, collect_r.sug );
325 inline bool isPatternsPackage( sat::Solvable depKeeper_r )
327 static const Capability indicator(
"pattern()" );
328 return depKeeper_r.provides().matches( indicator );
339 std::set<sat::Solvable> recTodo;
340 std::set<sat::Solvable> allDone;
344 std::set<sat::Solvable> reqTodo;
347 reqTodo.insert( depKeeper );
349 while ( ! reqTodo.empty() )
352 depKeeper = ( *reqTodo.begin() );
353 reqTodo.erase( reqTodo.begin() );
354 allDone.insert( depKeeper );
358 dependsSet( depKeeper, result );
363 if ( collect_r.
req.
insert( solv ) && recursively_r && isPatternsPackage( solv ) )
364 reqTodo.insert( solv );
368 if ( collect_r.
rec.
insert( solv ) && recursively_r && isPatternsPackage( solv ) )
369 recTodo.insert( solv );
378 while ( ! recTodo.empty() )
381 depKeeper = ( *recTodo.begin() );
382 recTodo.erase( recTodo.begin() );
383 if ( ! allDone.insert( depKeeper ).second )
388 dependsSet( depKeeper, result );
394 if ( collect_r.
rec.
insert( solv ) && recursively_r && isPatternsPackage( solv ) )
395 recTodo.insert( solv );
399 if ( collect_r.
rec.
insert( solv ) && recursively_r && isPatternsPackage( solv ) )
400 recTodo.insert( solv );
static const CapMatch yes
Container of Capability (currently read only).
CapDetail detail() const
Helper providing more detailed information about a Capability.
std::string asString() const
Access to the sat-pools string space.
constexpr bool empty() const
Whether the string is empty.
'Language[_Country]' codes.
Contents core() const
Ui hint: Required Packages.
NameList extends() const
Ui hint: patterns this one extends.
sat::SolvableSet Contents
std::string category(const Locale &lang_r=Locale()) const
Contents depends(bool includeSuggests_r=true) const
Ui hint: Dependent packages.
TraitsType::constPtrType constPtr
Pattern(const sat::Solvable &solvable_r)
Ctor.
sat::ArrayAttr< IdString, IdString > NameList
std::string order() const
void contentsSet(ContentsSet &collect_r, bool recursively_r=false) const
Dependency based content set (does not evaluate includes/extends relation).
sat::Solvable autoPackage() const
The corresponding patterns- package if isAutoPattern.
NameList includes() const
Ui hint: included patterns.
Contents contents(bool includeSuggests_r=true) const
The collection of packages associated with this pattern.
bool isAutoPattern() const
This patterns is auto-defined by a patterns- package.
Combining sat::Solvable and ResStatus.
Base for resolvable objects.
static ResPool instance()
Singleton ctor.
LookupAttr::TransformIterator based container to retrieve list attributes.
static const SolvAttr icon
static const SolvAttr isvisible
static const SolvAttr category
static const SolvAttr isdefault
static const SolvAttr extends
static const SolvAttr script
static const SolvAttr order
static const SolvAttr includes
Solvable set wrapper to allow adding additional convenience iterators.
Container & get()
The set.
bool insert(const TSolv &solv_r)
Insert a Solvable.
const_iterator end() const
Iterator pointing behind the last Solvable.
const_iterator begin() const
Iterator pointing to the first Solvable.
A Solvable object within the sat Pool.
Container of Solvable providing a Capability (read only).
intrusive_ptr< Selectable > Ptr
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Capability > CapabilitySet
MapKVIteratorTraits< TMap >::Key_const_iterator make_map_key_begin(const TMap &map_r)
Convenience to create the key iterator from container::begin()
filter_iterator< TFilter, typename TContainer::const_iterator > make_filter_begin(TFilter f, const TContainer &c)
Convenience to create filter_iterator from container::begin().
MapKVIteratorTraits< TMap >::Key_const_iterator make_map_key_end(const TMap &map_r)
Convenience to create the key iterator from container::end()
filter_iterator< TFilter, typename TContainer::const_iterator > make_filter_end(TFilter f, const TContainer &c)
Convenience to create filter_iterator from container::end().
Enumeration class of dependency types.
static const Dep SUGGESTS
static const Dep REQUIRES
static const Dep RECOMMENDS
transform_iterator< GetPairFirst< typename MapType::value_type >, typename MapType::const_iterator > Key_const_iterator
The key iterator type.
Contents req
required content set
Contents sug
suggested content set
Contents rec
recommended content set
Capabilities provides() const
bool lookupBoolAttribute(const SolvAttr &attr) const
std::string lookupStrAttribute(const SolvAttr &attr) const
Solvable satSolvable() const
Return the corresponding sat::Solvable.
Repository repository() const
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
#define IMPL_PTR_TYPE(NAME)