Provide ContentIdentifier of required update repositories in Product (Fate#316160)
authorMichael Andres <ma@suse.de>
Fri, 14 Feb 2014 12:50:56 +0000 (13:50 +0100)
committerMichael Andres <ma@suse.de>
Fri, 14 Feb 2014 12:50:56 +0000 (13:50 +0100)
zypp/Product.cc
zypp/Product.h

index d04d423..79f54a6 100644 (file)
@@ -205,6 +205,16 @@ namespace zypp
   Date Product::endOfLife() const
   { return Date( lookupNumAttribute( sat::SolvAttr::productEndOfLife ) );}
 
+  unsigned Product::updateContentIdentifierSize( std::list<Repository::ContentIdentifier> & ret_r ) const
+  {
+    sat::LookupAttr q( sat::SolvAttr::productUpdatesRepoid, sat::SolvAttr::productUpdates, *this );
+    for_( it, q.begin(), q.end() )
+    {
+      ret_r.push_back( it.asString() );
+    }
+    return q.size();
+  }
+
   bool Product::isTargetDistribution() const
   { return isSystem() && lookupStrAttribute( sat::SolvAttr::productType ) == "base"; }
 
index 0ef2795..e699c44 100644 (file)
@@ -100,6 +100,11 @@ namespace zypp
     /** The date when this Product goes out of support as indicated by it's medadata. */
     Date endOfLife() const;
 
+    /** ContentIdentifier of required update repositories.
+     * \todo remove and provide iterator.
+     */
+    unsigned updateContentIdentifierSize( std::list<Repository::ContentIdentifier> & ret_r ) const;
+
   public:
     /** This is the \b installed product that is also targeted by the
      *  \c /etc/products.d/baseproduct symlink.