- Fix some Patch and Pattern attributes.
authorMichael Andres <ma@suse.de>
Tue, 8 Apr 2008 15:12:11 +0000 (15:12 +0000)
committerMichael Andres <ma@suse.de>
Tue, 8 Apr 2008 15:12:11 +0000 (15:12 +0000)
- Prepare Patch and Pattern contents.

21 files changed:
zypp/CMakeLists.txt
zypp/Capability.h
zypp/Locale.h
zypp/Message.h
zypp/Patch.cc
zypp/Patch.h
zypp/Pattern.cc
zypp/Pattern.h
zypp/ResObject.h
zypp/base/LogTools.h
zypp/base/Tr1hash.h [new file with mode: 0644]
zypp/pool/PoolTraits.h
zypp/sat/SolvAttr.cc
zypp/sat/SolvAttr.h
zypp/sat/Solvable.h
zypp/sat/SolvableSet.cc [new file with mode: 0644]
zypp/sat/SolvableSet.h [new file with mode: 0644]
zypp/sat/WhatProvides.cc
zypp/sat/detail/PoolImpl.h
zypp/sat/detail/PoolMember.h
zypp/ui/PatternExpander.cc

index b3c8658..d4136a3 100644 (file)
@@ -242,6 +242,7 @@ SET( zypp_base_HEADERS
   base/String.h
   base/Regex.h
   base/Sysconfig.h
+  base/Tr1hash.h
   base/Unit.h
   base/WatchFile.h
 )
@@ -513,6 +514,7 @@ INSTALL(  FILES
 SET( zypp_sat_SRCS
   sat/Pool.cc
   sat/Solvable.cc
+  sat/SolvableSet.cc
   sat/WhatProvides.cc
   sat/LocaleSupport.cc
   sat/LookupAttr.cc
@@ -523,6 +525,7 @@ SET( zypp_sat_SRCS
 SET( zypp_sat_HEADERS
   sat/Pool.h
   sat/Solvable.h
+  sat/SolvableSet.h
   sat/WhatProvides.h
   sat/LocaleSupport.h
   sat/LookupAttr.h
index 7493690..99d4349 100644 (file)
@@ -13,7 +13,6 @@
 #define ZYPP_CAPABILITY_H
 
 #include <iosfwd>
-#include <tr1/unordered_set>
 
 #include "zypp/base/SafeBool.h"
 #include "zypp/base/Deprecated.h"
index 4540077..d75ffd8 100644 (file)
@@ -13,9 +13,9 @@
 #define ZYPP_LOCALE_H
 
 #include <iosfwd>
-#include <tr1/unordered_set>
 
 #include "zypp/base/PtrTypes.h"
+#include "zypp/base/Tr1hash.h"
 
 #include "zypp/IdString.h"
 #include "zypp/LanguageCode.h"
index 0d70b53..3eeb4c8 100644 (file)
@@ -12,6 +12,7 @@
 #ifndef ZYPP_MESSAGE_H
 #define ZYPP_MESSAGE_H
 
+#include "zypp/TranslatedText.h"
 #include "zypp/ResObject.h"
 
 ///////////////////////////////////////////////////////////////////
index 04dd40b..5c35074 100644 (file)
@@ -10,6 +10,7 @@
  *
 */
 #include "zypp/Patch.h"
+#include "zypp/Message.h"
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
@@ -40,89 +41,41 @@ namespace zypp
   //
   ///////////////////////////////////////////////////////////////////
 
-  std::string Patch::id() const
-  { return std::string(); }
-
-  Date Patch::timestamp() const
-  { return Date(); }
-
   std::string Patch::category() const
-  { return std::string(); }
+  { return lookupStrAttribute( sat::SolvAttr::patchcategory ); }
 
   bool Patch::reboot_needed() const
-  { return false; }
+  { return lookupBoolAttribute( sat::SolvAttr::needReboot ); }
 
   bool Patch::affects_pkg_manager() const
-  { return false; }
+  { return lookupBoolAttribute( sat::SolvAttr::needRestart ); }
 
-#warning Implement PATCH::ATOMS
-#if 0
-  Patch::AtomList Patch::atoms() const
+  bool Patch::interactive() const
   {
-      if ( ! _atomlist )
+    if ( reboot_needed()
+         || ! licenseToConfirm().empty() )
+    {
+      return true;
+    }
+
+    Patch::Contents c( contents() );
+    for_( it, c.begin(), c.end() )
+    {
+      if ( it->isKind( ResKind::message )
+           || ! licenseToConfirm().empty() )
       {
-        if ( ! hasBackRef() )
-        {
-          // We are not jet connected to the Resolvable that
-          // contains our dependencies.
-          return AtomList();
-        }
-
-        // lazy init
-        _atomlist.reset( new AtomList );
-
-        // Build the list using the repositories resolvables.
-        // Installed Patches (no repository) have this method overloaded.
-        if ( repository() )
-        {
-          const CapSet &   requires( self()->dep( Dep::REQUIRES ) );
-          const ResStore & store( repository().resolvables() );
-
-          for_( req, requires.begin(), requires.end() )
-          {
-            // lookup Patch requirements that refer to an Atom, Script or Message.
-            if ( refersTo<Atom>( *req ) || refersTo<Script>( *req ) || refersTo<Message>( *req ) )
-            {
-              for_( res, store.begin(), store.end() )
-              {
-                // Collect ALL matches in the store.
-                if ( hasMatches( (*res)->dep( Dep::PROVIDES ), (*req) ) )
-                {
-                  _atomlist->push_back( *res );
-                }
-              }
-            }
-          }
-        }
+        return true;
       }
-      return *_atomlist;
-    return AtomList();
-  }
-#endif
+    }
 
-  bool Patch::interactive() const
-  {
-#warning Implement PATCH::INTERACTIVE
-#if 0
-      if ( reboot_needed()
-           || ! licenseToConfirm().empty() )
-        {
-          return true;
-        }
+    return false;
+  }
 
-      AtomList atoms = all_atoms();
-      for ( AtomList::const_iterator it = atoms.begin(); it != atoms.end(); it++)
-        {
-          if (    isKind<Message>( *it )
-               || ! licenseToConfirm().empty() )
-            {
-              return true;
-            }
-        }
 
-      return false;
-#endif
-    return false;
+  Patch::Contents Patch::contents() const
+  {
+#warning FILL contents
+    return Contents();
   }
 
   /////////////////////////////////////////////////////////////////
index 74be85e..4c686be 100644 (file)
@@ -30,39 +30,52 @@ namespace zypp
   */
   class Patch : public ResObject
   {
-  public:
-    typedef Patch                    Self;
-    typedef ResTraits<Self>          TraitsType;
-    typedef TraitsType::PtrType      Ptr;
-    typedef TraitsType::constPtrType constPtr;
+    public:
+      typedef Patch                    Self;
+      typedef ResTraits<Self>          TraitsType;
+      typedef TraitsType::PtrType      Ptr;
+      typedef TraitsType::constPtrType constPtr;
 
-  public:
-    typedef std::list<ResObject::Ptr> AtomList;
+    public:
+      typedef sat::SolvableSet Contents;
 
-  public:
-    /** Patch ID */
-    std::string id() const;
-    /** Patch time stamp */
-    Date timestamp() const;
-    /** Patch category (recommended, security,...) */
-    std::string category() const;
-    /** Does the system need to reboot to finish the update process? */
-    bool reboot_needed() const;
-    /** Does the patch affect the package manager itself? */
-    bool affects_pkg_manager() const;
-    /** Is the patch installation interactive? (does it need user input?) */
-    bool interactive() const;
+    public:
+      /** Patch time stamp */
+      Date timestamp() const
+      { return buildtime(); }
+      /** Patch category (recommended, security,...) */
+      std::string category() const;
+      /** Does the system need to reboot to finish the update process? */
+      bool reboot_needed() const;
+      /** Does the patch affect the package manager itself? */
+      bool affects_pkg_manager() const;
+      /** Is the patch installation interactive? (does it need user input?) */
+      bool interactive() const;
 
-    /** The list of all atoms building the patch */
-    ZYPP_DEPRECATED AtomList atoms() const
-    { return AtomList(); }
+    public:
+      /** The collection of packages associated with this patch. */
+      Contents contents() const;
 
-  protected:
-    friend Ptr make<Self>( const sat::Solvable & solvable_r );
-    /** Ctor */
-    Patch( const sat::Solvable & solvable_r );
-    /** Dtor */
-    virtual ~Patch();
+    public:
+      /** Patch ID
+       * \deprecated Seems to be unsused autobuild interal data?
+      */
+      ZYPP_DEPRECATED std::string id() const
+      { return std::string(); }
+
+      /** The list of all atoms building the patch
+       * \deprecated  Try contents().
+      */
+      typedef std::list<ResObject::Ptr> AtomList;
+      ZYPP_DEPRECATED AtomList atoms() const
+      { return AtomList(); }
+
+    protected:
+      friend Ptr make<Self>( const sat::Solvable & solvable_r );
+      /** Ctor */
+      Patch( const sat::Solvable & solvable_r );
+      /** Dtor */
+      virtual ~Patch();
   };
 
   /////////////////////////////////////////////////////////////////
index 680f9e9..9f0e7e7 100644 (file)
  *
 */
 #include <iostream>
+#include "zypp/base/Logger.h"
 
 #include "zypp/Pattern.h"
 
+using std::endl;
+
 ///////////////////////////////////////////////////////////////////
 namespace zypp
 { /////////////////////////////////////////////////////////////////
@@ -91,20 +94,21 @@ namespace zypp
   }
 #endif
 
-#warning implement PATTERN::INSTALL_PACKAGES
- const Capabilities & Pattern::includes() const
-  {
-    static Capabilities _val;
-    return _val;
-  }
+  Pattern::NameList Pattern::includes() const
+  { return NameList( sat::SolvAttr::includes, satSolvable() ); }
+
+  Pattern::NameList Pattern::extends() const
+  { return NameList( sat::SolvAttr::extends, satSolvable() ); }
 
-  const Capabilities & Pattern::extends() const
+  Pattern::Contents Pattern::contents() const
   {
-    static Capabilities _val;
-    return _val;
+#warning FILL contents
+    ERR << *this << endl;
+    WAR << "  includes: " << includes() << endl;
+    WAR << "  extends:  " << extends() << endl;
+    return Contents();
   }
 
-
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
index 0d634ac..5db522b 100644 (file)
@@ -29,40 +29,47 @@ namespace zypp
   */
   class Pattern : public ResObject
   {
-  public:
-    typedef Pattern                  Self;
-    typedef ResTraits<Self>          TraitsType;
-    typedef TraitsType::PtrType      Ptr;
-    typedef TraitsType::constPtrType constPtr;
+    public:
+      typedef Pattern                  Self;
+      typedef ResTraits<Self>          TraitsType;
+      typedef TraitsType::PtrType      Ptr;
+      typedef TraitsType::constPtrType constPtr;
 
-  public:
-   typedef sat::ArrayAttr<IdString,IdString> NameList;
+    public:
+      typedef sat::ArrayAttr<IdString,IdString> NameList;
+      typedef sat::SolvableSet                  Contents;
 
-  public:
-    /** */
-    bool isDefault() const;
-    /** */
-    bool userVisible() const;
-    /** */
-    std::string category( const Locale & lang_r = Locale() ) const;
-    /** */
-    Pathname icon() const;
-    /** */
-    Pathname script() const;
-    /** */
-    std::string order() const;
+    public:
+      /** */
+      bool isDefault() const;
+      /** */
+      bool userVisible() const;
+      /** */
+      std::string category( const Locale & lang_r = Locale() ) const;
+      /** */
+      Pathname icon() const;
+      /** */
+      Pathname script() const;
+      /** */
+      std::string order() const;
 
-    /** Ui hint. */
-    const Capabilities & includes() const;
-    /** Ui hint. */
-    const Capabilities & extends() const;
+    public:
+      /** Ui hint. */
+      NameList includes() const;
+      /** Ui hint. */
+      NameList extends() const;
 
-  protected:
-    friend Ptr make<Self>( const sat::Solvable & solvable_r );
-    /** Ctor */
-    Pattern( const sat::Solvable & solvable_r );
-    /** Dtor */
-    virtual ~Pattern();
+      /** The collection of packages associated with this patch.
+        * This also evaluates the patterns includes/extends relation.
+       */
+      Contents contents() const;
+
+    protected:
+      friend Ptr make<Self>( const sat::Solvable & solvable_r );
+      /** Ctor */
+      Pattern( const sat::Solvable & solvable_r );
+      /** Dtor */
+      virtual ~Pattern();
   };
   ///////////////////////////////////////////////////////////////////
 
index 81295ce..df37610 100644 (file)
@@ -24,8 +24,7 @@
 #include "zypp/Repository.h"
 
 #include "zypp/sat/LookupAttr.h"
-
-#include "zypp/TranslatedText.h"
+#include "zypp/sat/SolvableSet.h"
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
index 5ca601d..5bedb6a 100644 (file)
@@ -18,8 +18,8 @@
 #include <list>
 #include <set>
 #include <map>
-#include <tr1/unordered_set>
-#include <tr1/unordered_map>
+
+#include "zypp/base/Tr1hash.h"
 #include "zypp/base/Logger.h"
 #include "zypp/base/Iterator.h"
 #include "zypp/base/Deprecated.h"
diff --git a/zypp/base/Tr1hash.h b/zypp/base/Tr1hash.h
new file mode 100644 (file)
index 0000000..617febe
--- /dev/null
@@ -0,0 +1,55 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file      zypp/base/Tr1hash.h
+ *
+*/
+#ifndef ZYPP_BASE_TR1HASH_H
+#define ZYPP_BASE_TR1HASH_H
+
+#include <iosfwd>
+#include <tr1/unordered_set>
+#include <tr1/unordered_map>
+
+#include "zypp/base/PtrTypes.h"
+
+/** Define hash function for id based classes.
+ * Class has to provide a method \c id() retuning a unique number.
+ * \code
+ *  // in global namespace define:
+ *  ZYPP_DEFINE_ID_HASHABLE( ::zypp::sat::Sovable )
+ * \endcode
+ */
+#define ZYPP_DEFINE_ID_HASHABLE(C)           \
+namespace std { namespace tr1 {              \
+  template<class _Tp> struct hash;           \
+  template<> struct hash<C>                  \
+  {                                          \
+    size_t operator()( const C & __s ) const \
+    { return __s.id(); }                     \
+  };                                         \
+}}
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+  /** clone function for RW_pointer */
+  template<class _D>
+  inline std::tr1::unordered_set<_D> * rwcowClone( const std::tr1::unordered_set<_D> * rhs )
+  { return new std::tr1::unordered_set<_D>( *rhs ); }
+
+  /** clone function for RW_pointer */
+  template<class _K, class _V>
+  inline std::tr1::unordered_map<_K,_V> * rwcowClone( const std::tr1::unordered_map<_K,_V> * rhs )
+  { return new std::tr1::unordered_map<_K,_V>( *rhs ); }
+
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_BASE_TR1HASH_H
index 3263295..a6c7441 100644 (file)
 #include <map>
 #include <list>
 #include <vector>
-#include <tr1/unordered_map>
 
 #include "zypp/base/Iterator.h"
-#include "zypp/base/Iterator.h"
+#include "zypp/base/Tr1hash.h"
 
 #include "zypp/PoolItem.h"
 #include "zypp/sat/Pool.h"
index 8c83759..ae56371 100644 (file)
@@ -33,7 +33,7 @@ namespace sat
 #warning STILL ATTRIBUTES HERE WHICH ARE NOT PROVIDED BY SOLV FILES
 // At least the ones that do nat have a satsolver/knownid.
 
-  const SolvAttr SolvAttr::name         ( SOLVABLE_NAME ); 
+  const SolvAttr SolvAttr::name         ( SOLVABLE_NAME );
   const SolvAttr SolvAttr::summary      ( SOLVABLE_SUMMARY );       // translated
   const SolvAttr SolvAttr::description  ( SOLVABLE_DESCRIPTION );   // translated
   const SolvAttr SolvAttr::insnotify    ( SOLVABLE_MESSAGEINS );    // translated
@@ -68,6 +68,8 @@ namespace sat
 
   // patch
   const SolvAttr SolvAttr::patchcategory( SOLVABLE_PATCHCATEGORY );
+  const SolvAttr SolvAttr::needReboot   ( UPDATE_REBOOT );
+  const SolvAttr SolvAttr::needRestart  ( UPDATE_RESTART );
 
   //pattern
   const SolvAttr SolvAttr::isvisible    ( SOLVABLE_ISVISIBLE );
index 9126b6c..eb7fc61 100644 (file)
@@ -76,6 +76,8 @@ namespace sat
 
       // patch
       static const SolvAttr patchcategory;
+      static const SolvAttr needReboot;
+      static const SolvAttr needRestart;
 
       // patern
       static const SolvAttr isvisible;
index 07e39be..345879b 100644 (file)
@@ -301,4 +301,7 @@ namespace zypp
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
+
+ZYPP_DEFINE_ID_HASHABLE( ::zypp::sat::Solvable )
+
 #endif // ZYPP_SAT_SOLVABLE_H
diff --git a/zypp/sat/SolvableSet.cc b/zypp/sat/SolvableSet.cc
new file mode 100644 (file)
index 0000000..2834f3f
--- /dev/null
@@ -0,0 +1,41 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file      zypp/sat/SolvableSet.cc
+ *
+*/
+#include <iostream>
+#include "zypp/base/LogTools.h"
+
+#include "zypp/sat/SolvableSet.h"
+
+using std::endl;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace sat
+  { /////////////////////////////////////////////////////////////////
+
+    /******************************************************************
+    **
+    ** FUNCTION NAME : operator<<
+    ** FUNCTION TYPE : std::ostream &
+    */
+    std::ostream & operator<<( std::ostream & str, const SolvableSet & obj )
+    {
+      return dumpRange( str, obj.begin(), obj.end() );
+    }
+
+    /////////////////////////////////////////////////////////////////
+  } // namespace sat
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff --git a/zypp/sat/SolvableSet.h b/zypp/sat/SolvableSet.h
new file mode 100644 (file)
index 0000000..5482691
--- /dev/null
@@ -0,0 +1,93 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file      zypp/sat/SolvableSet.h
+ *
+*/
+#ifndef ZYPP_SAT_SOLVABLESET_H
+#define ZYPP_SAT_SOLVABLESET_H
+
+#include <iosfwd>
+
+#include "zypp/base/PtrTypes.h"
+#include "zypp/base/Tr1hash.h"
+#include "zypp/sat/Solvable.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace sat
+  { /////////////////////////////////////////////////////////////////
+
+    ///////////////////////////////////////////////////////////////////
+    //
+    // CLASS NAME : SolvableSet
+    //
+    /** Solvable set wrapper to allow adding additioanal convenience iterators.
+     */
+    class SolvableSet
+    {
+      friend std::ostream & operator<<( std::ostream & str, const SolvableSet & obj );
+
+      public:
+        typedef std::tr1::unordered_set<Solvable> Container;
+        typedef Container::value_type     value_type;
+        typedef Container::size_type      size_type;
+        typedef Container::const_iterator const_iterator;
+
+      public:
+        /** Default ctor */
+        SolvableSet()
+        : _pimpl( new Container )
+        {}
+
+        /** Ctor building a set from a range. */
+        template<class _InputIterator>
+        SolvableSet( _InputIterator begin_r, _InputIterator end_r )
+        : _pimpl( new Container( begin_r, end_r ) )
+        {}
+
+      public:
+        /** Whether the set is epmty. */
+        bool empty() const
+        { return _pimpl->empty(); }
+
+        /** Size of the set. */
+        size_type size() const
+        { return _pimpl->size(); }
+
+        /** Iterator pointing to the first \ref Solvable. */
+        const_iterator begin() const
+        { return _pimpl->begin(); }
+
+        /** Iterator pointing behind the last \ref Solvable. */
+        const_iterator end() const
+        { return _pimpl->end(); }
+
+      public:
+        /** The set. */
+        Container & get()
+        { return *_pimpl; }
+
+      private:
+        /** Pointer to implementation */
+        RWCOW_pointer<Container> _pimpl;
+    };
+    ///////////////////////////////////////////////////////////////////
+
+    /** \relates SolvableSet Stream output */
+    std::ostream & operator<<( std::ostream & str, const SolvableSet & obj );
+
+    /////////////////////////////////////////////////////////////////
+  } // namespace sat
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_SAT_SOLVABLESET_H
index fc98715..39f45d5 100644 (file)
@@ -10,7 +10,6 @@
  *
 */
 #include <iostream>
-#include <tr1/unordered_set>
 
 #include "zypp/base/LogTools.h"
 #include "zypp/sat/WhatProvides.h"
index dd148c7..8aa42d1 100644 (file)
@@ -20,8 +20,8 @@ extern "C"
 #include <satsolver/repo_solv.h>
 }
 #include <iosfwd>
-#include <tr1/unordered_set>
 
+#include "zypp/base/Tr1hash.h"
 #include "zypp/base/NonCopyable.h"
 #include "zypp/base/SerialNumber.h"
 #include "zypp/sat/detail/PoolMember.h"
index b31a5b8..3349b7f 100644 (file)
@@ -12,6 +12,7 @@
 #ifndef ZYPP_SAT_DETAIL_POOLMEMBER_H
 #define ZYPP_SAT_DETAIL_POOLMEMBER_H
 
+#include "zypp/base/Tr1hash.h"
 #include "zypp/base/Iterator.h"
 #include "zypp/base/String.h"
 #include "zypp/base/Easy.h"
@@ -23,16 +24,6 @@ struct _Repo;
 struct _Pool;
 }
 
-#define ZYPP_DEFINE_ID_HASHABLE(C)           \
-namespace std { namespace tr1 {              \
-  template<class _Tp> struct hash;           \
-  template<> struct hash<C>                  \
-  {                                          \
-    size_t operator()( const C & __s ) const \
-    { return __s.id(); }                     \
-  };                                         \
-}}
-
 ///////////////////////////////////////////////////////////////////
 namespace zypp
 { /////////////////////////////////////////////////////////////////
index 7cdbb2f..8952dc5 100644 (file)
@@ -79,12 +79,11 @@ namespace zypp
       /** Store all included patterns in \c _patternMap. */
       void expandIncludes( const Pattern::constPtr & pat_r )
       {
-        if ( ! pat_r->includes().empty() )
-          {
-            std::for_each( pat_r->includes().begin(),
-                           pat_r->includes().end(),
-                           bind( &Impl::expandInclude, this, _1 ) );
-          }
+        Pattern::NameList c( pat_r->includes() );
+        for_( it, c.begin(), c.end() )
+        {
+          expandInclude( Capability( it->c_str(), ResKind::pattern ) );
+        }
       }
 
       /** Store Patterns matching an \c Includes capability in \c _patternMap. */
@@ -101,9 +100,12 @@ namespace zypp
       /** Store all patterns extending \c pat_r in \c _patternMap. */
       void expandExtending( const Pattern::constPtr & pat_r )
       {
-        std::for_each( _pool.byKindBegin<Pattern>(),
-                       _pool.byKindEnd<Pattern>(),
-                       bind( &Impl::expandIfExtends, this, pat_r, _1 ) );
+        Pattern::NameList c( pat_r->extends() );
+        for_( it, c.begin(), c.end() )
+        {
+#warning TBD
+          //expandIfExtends( pat_r, Capability( it->c_str(), ResKind::pattern ) );
+        }
       }
 
       /** Store \c extending_r if it extends \c pat_r. */
@@ -113,6 +115,8 @@ namespace zypp
 
         if ( ! extending->extends().empty() )
           {
+#warning TBD
+#if 0
             if ( std::find_if( extending->extends().begin(),
                                extending->extends().end(),
                                bind( &Impl::providedBy, this, pat_r, _1 ) )
@@ -122,6 +126,7 @@ namespace zypp
                 _patternMap[extending];
                 //DBG << mapEntry(*_patternMap.find(extending)) << endl;
               }
+#endif
           }
       }