Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / Product.cc
index f195add..d5ef49b 100644 (file)
@@ -91,7 +91,7 @@ namespace zypp
     {
       if ( it->repository() == repository() && it->arch() == arch() )
       {
-       bool fitsBuildtime = ( PoolItem(*it)->buildtime() == buildtime() );
+       bool fitsBuildtime = ( it->buildtime() == buildtime() );
        if ( found )
        {
          bool lowerEdition = ( it->edition() <= found.edition() );
@@ -214,6 +214,19 @@ namespace zypp
   Date Product::endOfLife() const
   { return Date( lookupNumAttribute( sat::SolvAttr::productEndOfLife ) );}
 
+  bool Product::hasEndOfLife() const
+  { return( lookupNumAttribute( sat::SolvAttr::productEndOfLife, -1 ) != -1 ); }
+
+  bool Product::hasEndOfLife( Date & value ) const
+  {
+    Date res( lookupNumAttribute( sat::SolvAttr::productEndOfLife, -1 ) );
+    if ( res == -1 )
+      return false;
+    // else:
+    value = res;
+    return true;
+  }
+
   std::vector<Repository::ContentIdentifier> Product::updateContentIdentifier() const
   {
     std::vector<Repository::ContentIdentifier> ret;