libzypp: zypp::Product Class Reference

libzypp 17.25.10

Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
zypp::Product Class Reference

Product interface. More...

`#include <Product.h>`

Inheritance diagram for zypp::Product:
[legend]

## Classes
class | UrlList
| Helper to iterate a products URL lists. More...

## Public Types
typedef Product | Self
typedef ResTraits< Self > | TraitsType
typedef TraitsType::PtrType | Ptr
typedef TraitsType::constPtrType | constPtr
typedef std::vector< constPtr > | ReplacedProducts
Public Types inherited from zypp::ResObject
typedef ResObject | Self
typedef ResTraits< Self > | TraitsType
typedef TraitsType::PtrType | Ptr
typedef TraitsType::constPtrType | constPtr
Public Types inherited from zypp::Resolvable
typedef Resolvable | Self
typedef ResTraits< Self > | TraitsType
typedef TraitsType::KindType | Kind
typedef TraitsType::PtrType | Ptr
typedef TraitsType::constPtrType | constPtr

## Public Member Functions
sat::Solvable | referencePackage () const
| The reference package providing the product metadata, if such a package exists. More...
std::string | referenceFilename () const
| For installed products the name of the corresponding `/etc/products`.d entry. More...
CapabilitySet | droplist () const
| List of packages included in older versions of this product and now dropped. More...
ReplacedProducts | replacedProducts () const
| Array of installed Products that would be replaced by installing this one. More...
std::string | productLine () const
| Vendor specific string denoting the product line. More...
std::string | shortName () const
| Untranslated short name like `SLES 10` (fallback: name) More...
std::string | flavor () const
| The product flavor (LiveCD Demo, FTP edition,...). More...
std::string | type () const
| Get the product type Well, in an ideal world there is only one base product. More...
std::list< std::string > | flags () const
| The product flags. More...
Date | endOfLife () const
| The date when this Product goes out of support as indicated by it's medadata. More...
bool | hasEndOfLife () const
| Return whether an EndOfLife value is actually defined in the metadata. More...
bool | hasEndOfLife (Date &value) const
std::vector< Repository::ContentIdentifier > | updateContentIdentifier () const
| ContentIdentifier of required update repositories. More...
bool | hasUpdateContentIdentifier (const Repository::ContentIdentifier &cident_r) const
| Whether cident_r is listed as required update repository. More...
template<class TIterator >
bool | hasUpdateContentIdentifier (TIterator begin, TIterator end) const
| Whether one of the ContentIdentifier is listed as required update repository. More...
bool | isTargetDistribution () const
| This is the installed product that is also targeted by the `/etc/products`.d/baseproduct symlink. More...
std::string | registerTarget () const
| This is `register.target` attribute of a product. More...
std::string | registerRelease () const
| This is `register.release` attribute of an installed product. More...
std::string | registerFlavor () const
| This is `register.flavor` attribute of a product. More...
UrlList | urls (const std::string &key_r) const
| Retrieve URLs flagged with `key_r` for this product. More...
UrlList | releaseNotesUrls () const
| The URL to download the release notes for this product. More...
UrlList | registerUrls () const
| The URL for registration. More...
UrlList | smoltUrls () const
| The URL for SMOLT. More...
UrlList | updateUrls () const
| Online updates for the product. More...
UrlList | extraUrls () const
| Additional software for the product They are complementary, not alternatives. More...
UrlList | optionalUrls () const
| Optional software for the product. More...
Public Member Functions inherited from zypp::ResObject
template<class TRes >
ResTraits< TRes >::constPtrType | asKind () const
| Convert `this` into a Ptr of a certain Kind. More...
template<class TRes >
ResTraits< TRes >::PtrType | asKind ()
Vendor | vendor () const
| Vendor. More...
Public Member Functions inherited from zypp::Resolvable
| operator sat::Solvable () const
| This is a sat::SolvableType. More...
PoolItem | poolItem () const
| Access the corresponding PoolItem. More...
Public Member Functions inherited from zypp::sat::SolvableType< Resolvable >
Solvable | satSolvable () const
| Return the corresponding sat::Solvable. More...
| operator bool () const
IdString | ident () const
ResKind | kind () const
bool | isKind (const ResKind &kind_r) const
bool | isKind () const
bool | isKind (TIterator begin, TIterator end) const
std::string | name () const
Edition | edition () const
Arch | arch () const
IdString | vendor () const
Repository | repository () const
RepoInfo | repoInfo () const
bool | isSystem () const
bool | onSystemByUser () const
bool | onSystemByAuto () const
bool | identIsAutoInstalled () const
bool | multiversionInstall () const
bool | isNeedreboot () const
bool | isRetracted () const
bool | isPtf () const
Date | buildtime () const
Date | installtime () const
std::string | asString () const
std::string | asUserString () const
bool | identical (const Solvable &rhs) const
bool | identical (const SolvableType< RDerived > &rhs) const
bool | sameNVRA (const Solvable &rhs) const
bool | sameNVRA (const SolvableType< RDerived > &rhs) const
Capabilities | provides () const
Capabilities | conflicts () const
Capabilities | obsoletes () const
Capabilities | recommends () const
Capabilities | suggests () const
Capabilities | enhances () const
Capabilities | supplements () const
Capabilities | prerequires () const
Capabilities | dep (Dep which_r) const
Capabilities | operator[] (Dep which_r) const
CapabilitySet | providesNamespace (const std::string &namespace_r) const
CapabilitySet | valuesOfNamespace (const std::string &namespace_r) const
bool | supportsLocales () const
bool | supportsLocale (const Locale &locale_r) const
bool | supportsLocale (const LocaleSet &locales_r) const
bool | supportsRequestedLocales () const
LocaleSet | getSupportedLocales () const
CpeId | cpeId () const
unsigned | mediaNr () const
ByteCount | installSize () const
ByteCount | downloadSize () const
std::string | distribution () const
std::string | summary (const Locale &lang_r=Locale()) const
std::string | description (const Locale &lang_r=Locale()) const
std::string | insnotify (const Locale &lang_r=Locale()) const
std::string | delnotify (const Locale &lang_r=Locale()) const
std::string | licenseToConfirm (const Locale &lang_r=Locale()) const
bool | needToAcceptLicense () const
std::string | lookupStrAttribute (const SolvAttr &attr) const
std::string | lookupStrAttribute (const SolvAttr &attr, const Locale &lang_r) const
bool | lookupBoolAttribute (const SolvAttr &attr) const
detail::IdType | lookupIdAttribute (const SolvAttr &attr) const
unsigned long long | lookupNumAttribute (const SolvAttr &attr) const
unsigned long long | lookupNumAttribute (const SolvAttr &attr, unsigned long long notfound_r) const
CheckSum | lookupCheckSumAttribute (const SolvAttr &attr) const
OnMediaLocation | lookupLocation () const
Solvable::IdType | id () const
Public Member Functions inherited from zypp::base::ReferenceCounted
| ReferenceCounted ()
| Default ctor. More...
| ReferenceCounted (const ReferenceCounted &rhs)
| Copy ctor. More...
virtual | ~ReferenceCounted ()
| Dtor. More...
ReferenceCounted & | operator= (const ReferenceCounted &)
| Assignment. More...
unsigned | refCount () const
| Return reference counter value. More...
void | ref () const
| Add a reference. More...
void | unref () const
| Release a reference. More...

## Protected Member Functions
| Product (const sat::Solvable &solvable_r)
| Ctor. More...
virtual | ~Product ()
| Dtor. More...
Protected Member Functions inherited from zypp::ResObject
| ResObject (const sat::Solvable &solvable_r)
| Ctor. More...
virtual | ~ResObject ()
| Dtor. More...
virtual std::ostream & | dumpOn (std::ostream &str) const
| Helper for stream output. More...
| operator sat::Solvable () const
| This is a sat::SolvableType (allow implicit conversion in derived classes). More...
Protected Member Functions inherited from zypp::Resolvable
| Resolvable (const sat::Solvable &solvable_r)
| Ctor. More...
virtual | ~Resolvable ()
| Dtor. More...
Protected Member Functions inherited from zypp::sat::SolvableType< Resolvable >
| SolvableType ()
| SolvableType (const SolvableType &)
| SolvableType (SolvableType &&)
void | operator= (const SolvableType &)
void | operator= (SolvableType &&)
| ~SolvableType ()
Protected Member Functions inherited from zypp::base::ReferenceCounted
virtual void | ref_to (unsigned) const
| Trigger derived classes after refCount was increased. More...
virtual void | unref_to (unsigned) const
| Trigger derived classes after refCount was decreased. More...

## Friends
Ptr | make (const sat::Solvable &solvable_r)
| Directly create a certain kind of ResObject from sat::Solvable. More...

## Additional Inherited Members
Static Public Member Functions inherited from zypp::base::ReferenceCounted
static void | add_ref (const ReferenceCounted *ptr_r)
| Called by zypp::intrusive_ptr to add a reference. More...
static void | release (const ReferenceCounted *ptr_r)
| Called by zypp::intrusive_ptr to add a reference. More...
Public Attributes inherited from zypp::sat::SolvableType< Resolvable >
Capabilities | const
Related Functions inherited from zypp::ResObject
template<class TRes >
ResTraits< TRes >::PtrType | asKind (const ResObject::Ptr &p)
| Convert ResObject::Ptr into Ptr of a certain Kind. More...
Related Functions inherited from zypp::Resolvable
std::ostream & | operator<< (std::ostream &str, const Resolvable &obj)
| Stream output. More...
std::ostream & | dumpOn (std::ostream &str, const Resolvable &obj)
| More verbose stream output including dependencies. More...
template<class TRes >
bool | isKind (const Resolvable::constPtr &p)
| Test whether a Resolvable::Ptr is of a certain Kind. More...
template<class TRes >
ResTraits< TRes >::PtrType | asKind (const Resolvable::Ptr &p)
| Convert Resolvable::Ptr into Ptr of a certain Kind. More...
int | compareByN (const Resolvable::constPtr &lhs, const Resolvable::constPtr &rhs)
| Compare Resolvable::constPtr according to kind and name. More...
int | compareByNVR (const Resolvable::constPtr &lhs, const Resolvable::constPtr &rhs)
| Compare according to kind, name and edition. More...
int | compareByNVRA (const Resolvable::constPtr &lhs, const Resolvable::constPtr &rhs)
| Compare Resolvable::constPtr according to kind, name, edition and arch. More...
Related Functions inherited from zypp::sat::SolvableType< Resolvable >
bool | isKind (const SolvableType< Resolvable > &solvable_r)
| Test whether the Solvable is of a certain ResKind. More...
bool | identical (const SolvableType< LDerived > &lhs, const SolvableType< RDerived > &rhs)
| Test for same content. More...
bool | sameNVRA (const SolvableType< LDerived > &lhs, const SolvableType< RDerived > &rhs)
| Test for same name version release and arch. More...
std::ostream & | operator<< (std::ostream &str, const SolvableType< Resolvable > &obj)
| Stream output. More...
std::ostream & | dumpOn (std::ostream &str, const SolvableType< Resolvable > &obj)
| More verbose stream output including dependencies. More...
bool | operator== (const SolvableType< LDerived > &lhs, const SolvableType< RDerived > &rhs)
| Equal. More...
bool | operator!= (const SolvableType< LDerived > &lhs, const SolvableType< RDerived > &rhs)
| NotEqual. More...
bool | operator< (const SolvableType< LDerived > &lhs, const SolvableType< RDerived > &rhs)
| Less. More...
int | compareByN (const SolvableType< LDerived > &lhs, const SolvableType< RDerived > &rhs)
| Compare according to kind and name. More...
int | compareByNVR (const SolvableType< LDerived > &lhs, const SolvableType< RDerived > &rhs)
| Compare according to kind, name and edition. More...
int | compareByNVRA (const SolvableType< LDerived > &lhs, const SolvableType< RDerived > &rhs)
| Compare according to kind, name, edition and arch. More...
Related Functions inherited from zypp::base::ReferenceCounted
void | intrusive_ptr_add_ref (const ReferenceCounted *ptr_r)
| intrusive_ptr hook to add_ref. More...
void | intrusive_ptr_release (const ReferenceCounted *ptr_r)
| intrusive_ptr hook to release. More...
std::ostream & | operator<< (std::ostream &str, const ReferenceCounted &obj)
| Stream output. More...

## Detailed Description

Product interface.

Definition at line 32 of file Product.h.

## Member Typedef Documentation

## ◆ Self

typedef Product zypp::Product::Self

Definition at line 35 of file Product.h.

## ◆ TraitsType

typedef ResTraits<Self> zypp::Product::TraitsType

Definition at line 36 of file Product.h.

## ◆ Ptr

typedef TraitsType::PtrType zypp::Product::Ptr

Definition at line 37 of file Product.h.

## ◆ constPtr

typedef TraitsType::constPtrType zypp::Product::constPtr

Definition at line 38 of file Product.h.

## ◆ ReplacedProducts

typedef std::vector<constPtr> zypp::Product::ReplacedProducts

Definition at line 73 of file Product.h.

## Constructor & Destructor Documentation

## ◆ Product()

zypp::Product::Product | ( | const sat::Solvable & | solvable_r | ) |
| protected

Ctor.

Definition at line 49 of file Product.cc.

## ◆ ~Product()

zypp::Product::~Product | ( |  | ) |
| protectedvirtual

Dtor.

Definition at line 58 of file Product.cc.

## Member Function Documentation

## ◆ referencePackage()

sat::Solvable zypp::Product::referencePackage | ( |  | ) | const

The reference package providing the product metadata, if such a package exists.

Definition at line 63 of file Product.cc.

## ◆ referenceFilename()

std::string zypp::Product::referenceFilename | ( |  | ) | const

For installed products the name of the corresponding `/etc/products`.d entry.

Definition at line 116 of file Product.cc.

## ◆ droplist()

CapabilitySet zypp::Product::droplist | ( |  | ) | const

List of packages included in older versions of this product and now dropped.

This evaluates the referencePackage `weakremover` namespace. It actually returns a CapabilitySet, because we support to drop specific versions or version ranges of a package. Use sat::WhatProvides to get the actually installed and available packages matching this list.

const Product & openSUSE;
sat::WhatProvides dropped( openSUSE.droplist() );
for_( it, dropped.poolItemBegin(), dropped.poolItemEnd() )
{
if ( it->status().isInstalled() )
{
MIL << "Installed but no longer supported package: " << *it << endl;
}
}
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:28
MIL
#define MIL
Definition: Logger.h:91
zypp::Product::Product
Product(const sat::Solvable &solvable_r)
Ctor.
Definition: Product.cc:49

Definition at line 145 of file Product.cc.

## ◆ replacedProducts()

Product::ReplacedProducts zypp::Product::replacedProducts | ( |  | ) | const

Array of installed Products that would be replaced by installing this one.

Definition at line 119 of file Product.cc.

## ◆ productLine()

std::string zypp::Product::productLine | ( |  | ) | const

Vendor specific string denoting the product line.

Definition at line 148 of file Product.cc.

## ◆ shortName()

std::string zypp::Product::shortName | ( |  | ) | const

Untranslated short name like `SLES 10` (fallback: name)

Definition at line 153 of file Product.cc.

## ◆ flavor()

std::string zypp::Product::flavor | ( |  | ) | const

The product flavor (LiveCD Demo, FTP edition,...).

Definition at line 161 of file Product.cc.

## ◆ type()

std::string zypp::Product::type | ( |  | ) | const

Get the product type Well, in an ideal world there is only one base product.

It's the installed product denoted by a symlink in `/etc/products`.d.

Definition at line 190 of file Product.cc.

## ◆ flags()

std::list< std::string > zypp::Product::flags | ( |  | ) | const

The product flags.

Definition at line 193 of file Product.cc.

## ◆ endOfLife()

Date zypp::Product::endOfLife | ( |  | ) | const

The date when this Product goes out of support as indicated by it's medadata.

Use hasEOfLife if it's important to distinguish whether the value is not defined in the metadata, or defined but empty/invalid/TBD.

Definition at line 200 of file Product.cc.

## ◆ hasEndOfLife() [1/2]

bool zypp::Product::hasEndOfLife | ( |  | ) | const

Return whether an EndOfLife value is actually defined in the metadata.

A missing value (`false`) usually indicates that there will be no EOL, while an empty/invalid value indicates that there will be an EOL date, but it's not yet known (FATE#320699).

Definition at line 203 of file Product.cc.

## ◆ hasEndOfLife() [2/2]

bool zypp::Product::hasEndOfLife | ( | Date & | value | ) | const

Definition at line 206 of file Product.cc.

## ◆ updateContentIdentifier()

std::vector< Repository::ContentIdentifier > zypp::Product::updateContentIdentifier | ( |  | ) | const

ContentIdentifier of required update repositories.

Definition at line 216 of file Product.cc.

## ◆ hasUpdateContentIdentifier() [1/2]

bool zypp::Product::hasUpdateContentIdentifier | ( | const Repository::ContentIdentifier & | cident_r | ) | const

Whether cident_r is listed as required update repository.

Definition at line 229 of file Product.cc.

## ◆ hasUpdateContentIdentifier() [2/2]

template<class TIterator >

bool zypp::Product::hasUpdateContentIdentifier | ( | TIterator | begin,
|  | TIterator | end
| ) |  | const
| inline

Whether one of the ContentIdentifier is listed as required update repository.

Definition at line 127 of file Product.h.

## ◆ isTargetDistribution()

bool zypp::Product::isTargetDistribution | ( |  | ) | const

This is the installed product that is also targeted by the `/etc/products`.d/baseproduct symlink.

Definition at line 240 of file Product.cc.

## ◆ registerTarget()

std::string zypp::Product::registerTarget | ( |  | ) | const

This is `register.target` attribute of a product.

Used for registration and filtering service repos.

Definition at line 243 of file Product.cc.

## ◆ registerRelease()

std::string zypp::Product::registerRelease | ( |  | ) | const

This is `register.release` attribute of an installed product.

Used for registration.

Definition at line 246 of file Product.cc.

## ◆ registerFlavor()

std::string zypp::Product::registerFlavor | ( |  | ) | const

This is `register.flavor` attribute of a product.

Used for registration.

Definition at line 249 of file Product.cc.

## ◆ urls()

Product::UrlList zypp::Product::urls | ( | const std::string & | key_r | ) | const

Retrieve URLs flagged with `key_r` for this product.

This is the most common interface. There are convenience methods for wellknown flags like `"releasenotes"`, `"register"`, `"updateurls"`, `"extraurls"`, `"optionalurls"` and `"smolt"` below.

Definition at line 254 of file Product.cc.

## ◆ releaseNotesUrls()

Product::UrlList zypp::Product::releaseNotesUrls | ( |  | ) | const

The URL to download the release notes for this product.

Definition at line 282 of file Product.cc.

## ◆ registerUrls()

Product::UrlList zypp::Product::registerUrls | ( |  | ) | const

The URL for registration.

Definition at line 283 of file Product.cc.

## ◆ smoltUrls()

Product::UrlList zypp::Product::smoltUrls | ( |  | ) | const

The URL for SMOLT.

See also
  http://smolts.org/wiki/Main_Page.

Definition at line 284 of file Product.cc.

## ◆ updateUrls()

Product::UrlList zypp::Product::updateUrls | ( |  | ) | const

Online updates for the product.

They are complementary, not alternatives. #163192

Definition at line 285 of file Product.cc.

## ◆ extraUrls()

Product::UrlList zypp::Product::extraUrls | ( |  | ) | const

Additional software for the product They are complementary, not alternatives.

Definition at line 286 of file Product.cc.

## ◆ optionalUrls()

Product::UrlList zypp::Product::optionalUrls | ( |  | ) | const

Optional software for the product.

(for example. Non OSS repositories) They are complementary, not alternatives.

Definition at line 287 of file Product.cc.

## Friends And Related Function Documentation

## ◆ make

Ptr make | ( | const sat::Solvable & | solvable_r | ) |
| friend

Directly create a certain kind of ResObject from sat::Solvable.

If the sat::Solvables kind is not appropriate, a NULL pointer is returned.

sat::Solvable s;
ResObject::Ptr p( makeResObject( s ) );
ResObject::Ptr q( make<ResObject>( s ) );
Package::Ptr pkg( make<Package>( s ) );
zypp::Package::Ptr
TraitsType::PtrType Ptr
Definition: Package.h:37
zypp::ResObject::makeResObject
friend ResObject::Ptr makeResObject(const sat::Solvable &solvable_r)
Create ResObject from sat::Solvable.
Definition: ResObject.cc:43
zypp::ResObject::Ptr
TraitsType::PtrType Ptr
Definition: ResObject.h:42
zypp::make< ResObject >
ResObject::Ptr make< ResObject >(const sat::Solvable &solvable_r)
Definition: ResObject.h:122

Todo:
  make<> was a poor choice (AFAIR because gcc had some trouble with asKind<>(sat::Solvable)). Remove it in favour of asKind<>(sat::Solvable)

Definition at line 118 of file ResObject.h.

The documentation for this class was generated from the following files:

- zypp/Product.h
- zypp/Product.cc