- Added Pattern::core returning the packages required by a pattern.
authorMichael Andres <ma@suse.de>
Tue, 22 Apr 2008 08:37:37 +0000 (08:37 +0000)
committerMichael Andres <ma@suse.de>
Tue, 22 Apr 2008 08:37:37 +0000 (08:37 +0000)
package/libzypp.changes
zypp/Pattern.cc
zypp/Pattern.h

index 59b3ab12c0a62877838bcc57ba94c32f9b75de6f..c4d22606e88ae014d8620662e59b241b80c434a8 100644 (file)
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Tue Apr 22 10:33:03 CEST 2008 - ma@suse.de
+
+- Added Pattern::core returning the packages required by a pattern.
+  (see also Pattern::depends and Pattern::contents).
+- revision 9771
+
 -------------------------------------------------------------------
 Mon Apr 21 15:38:10 CEST 2008 - ma@suse.de
 
index 8f434c31447d3c7bd626e741e58644b40e027bfd..9d748a8bb10f2c1ee078254e3e8bec68a35d50b9 100644 (file)
@@ -205,6 +205,15 @@ namespace zypp
   Pattern::NameList Pattern::extends() const
   { return NameList( sat::SolvAttr::extends, satSolvable() ); }
 
+  Pattern::Contents Pattern::core() const
+  {
+    // get items providing the requirements
+    sat::WhatProvides prv( requires() );
+    // return packages only.
+    return Pattern::Contents( make_filter_begin( filter::byKind<Package>(), prv ),
+                              make_filter_end( filter::byKind<Package>(), prv ) );
+  }
+
   Pattern::Contents Pattern::depends() const
   {
     // load requires, recommends, suggests
index cc87495bd0e7f39f08d94b907532226a3dbfc42e..2a3fefd69ac5a0f7018e6446e0300b61103cc474 100644 (file)
@@ -60,7 +60,12 @@ namespace zypp
       /** Ui hint: patterns this one extends. */
       NameList extends() const;
 
-      /** Ui hint: Dependent packages. */
+      /** Ui hint: Required Packages. */
+      Contents core() const;
+
+      /** Ui hint: Dependent packages.
+       * This also includes recommended and suugested packages.
+      */
       Contents depends() const;
 
       /** The collection of packages associated with this pattern.