libzypp: zypp::VendorAttr Class Reference

libzypp 17.38.14

zypp::VendorAttr Class Reference

Definition of vendor equivalence. More...

`#include <zypp/VendorAttr.h>`

## Classes
class | Impl
| VendorAttr implementation. More...

## Public Types
using | VendorList = std::vector<std::string>
| Preferred type to pass equivalent vendor strings.

## Public Member Functions
| VendorAttr ()
| Ctor providing the default set.
| VendorAttr (const Pathname &initial_r)
| Ctor reading the initial_r definitions from a dir or file.
| ~VendorAttr ()
| Dtor.
| VendorAttr (const VendorAttr &)=default
| VendorAttr (VendorAttr &&) noexcept=default
VendorAttr & | operator= (const VendorAttr &)=default
VendorAttr & | operator= (VendorAttr &&) noexcept=default
bool | addVendorDirectory (const Pathname &dirname_r)
| Adding new equivalent vendors described in a directory.
bool | addVendorFile (const Pathname &filename_r)
| Adding new equivalent vendors described in a file.
void | addVendorList (VendorList &&list_r)
| Adding new equivalent vendor strings container.
void | addVendorList (const VendorList &list_r)
template<class TContainer>
void | addVendorList (const TContainer &container_r)
template<class TStr>
void | addVendorList (const std::initializer_list< TStr > &container_r)
bool | equivalent (const Vendor &lVendor, const Vendor &rVendor) const
| Return whether two vendor strings should be treated as the same vendor.
bool | equivalent (IdString lVendor, IdString rVendor) const
bool | equivalent (sat::Solvable lVendor, sat::Solvable rVendor) const
bool | equivalent (const PoolItem &lVendor, const PoolItem &rVendor) const
bool | relaxedEquivalent (const Vendor &lVendor, const Vendor &rVendor) const
| Like equivalent but always unifies suse and openSUSE vendor.
bool | relaxedEquivalent (IdString lVendor, IdString rVendor) const
bool | relaxedEquivalent (sat::Solvable lVendor, sat::Solvable rVendor) const
bool | relaxedEquivalent (const PoolItem &lVendor, const PoolItem &rVendor) const
unsigned | foreachVendorList (std::function< bool(VendorList)> fnc_r) const
| Call fnc_r for each equivalent vendor list (return `false` to break).
void | _addVendorList (VendorList &&list_r)

## Static Public Member Functions
static const VendorAttr & | instance ()
| (Pseudo)Singleton, mapped to the current Target::vendorAttr settings or to noTargetInstance.
static VendorAttr & | noTargetInstance ()
| Singleton, settings used if no Target is active.

## Public Attributes
RWCOW_pointer< Impl > | _pimpl
| Implementation class.

## Friends
std::ostream & | operator<< (std::ostream &str, const VendorAttr &obj)
| relates: VendorAttr Stream output

## Detailed Description

Definition of vendor equivalence.

Packages with equivalent vendor strings may replace themselves without creating a solver error.

Per default vendor strings starting with `"suse"` are treated as being equivalent. This may be tuned by providing customized vendor description files in `/etc/zypp/vendors`.d.

[main]
vendors = MyVendor,AlternateName

By this vendor strings starting with "MyVendor" or "AlternateName" are considered to be equivalent. Packages from equivalent vendors may replace each other without being considered as a 'vendor change'.

Note
  bnc#812608: Within the "opensuse*" namespace exact matches (case insensitive) are required. "vendors = suse,opensuse" will allow switching between "suse*" and "opensuse", but not e.g. "opensuse build service".

See also
  Solver - Vendor protection

Definition at line 60 of file VendorAttr.h.

## Member Typedef Documentation

## ◆ VendorList

using zypp::VendorAttr::VendorList = std::vector<std::string>

Preferred type to pass equivalent vendor strings.

Definition at line 100 of file VendorAttr.h.

## Constructor & Destructor Documentation

## ◆ VendorAttr() [1/4]

zypp::VendorAttr::VendorAttr | ( |  | ) |

Ctor providing the default set.

Definition at line 242 of file VendorAttr.cc.

## ◆ VendorAttr() [2/4]

zypp::VendorAttr::VendorAttr | ( | const Pathname & | initial_r | ) |

Ctor reading the initial_r definitions from a dir or file.

Definition at line 248 of file VendorAttr.cc.

## ◆ ~VendorAttr()

zypp::VendorAttr::~VendorAttr | ( |  | ) |

Dtor.

Definition at line 255 of file VendorAttr.cc.

## ◆ VendorAttr() [3/4]

zypp::VendorAttr::VendorAttr | ( | const VendorAttr & |  | ) |
| default

## ◆ VendorAttr() [4/4]

zypp::VendorAttr::VendorAttr | ( | VendorAttr && |  | ) |
| defaultnoexcept

## Member Function Documentation

## ◆ instance()

const VendorAttr & zypp::VendorAttr::instance | ( |  | ) |
| static

(Pseudo)Singleton, mapped to the current Target::vendorAttr settings or to noTargetInstance.

Definition at line 230 of file VendorAttr.cc.

## ◆ noTargetInstance()

VendorAttr & zypp::VendorAttr::noTargetInstance | ( |  | ) |
| static

Singleton, settings used if no Target is active.

The instance is initialized with the settings found in the system below /. The active Targets settings can be changed via Target::vendorAttr.

Definition at line 236 of file VendorAttr.cc.

## ◆ operator=() [1/2]

VendorAttr & zypp::VendorAttr::operator= | ( | const VendorAttr & |  | ) |
| default

## ◆ operator=() [2/2]

VendorAttr & zypp::VendorAttr::operator= | ( | VendorAttr && |  | ) |
| defaultnoexcept

## ◆ addVendorDirectory()

bool zypp::VendorAttr::addVendorDirectory | ( | const Pathname & | dirname_r | ) |

Adding new equivalent vendors described in a directory.

Definition at line 258 of file VendorAttr.cc.

## ◆ addVendorFile()

bool zypp::VendorAttr::addVendorFile | ( | const Pathname & | filename_r | ) |

Adding new equivalent vendors described in a file.

Definition at line 275 of file VendorAttr.cc.

## ◆ addVendorList() [1/4]

void zypp::VendorAttr::addVendorList | ( | VendorList && | list_r | ) |
| inline

Adding new equivalent vendor strings container.

Definition at line 105 of file VendorAttr.h.

## ◆ addVendorList() [2/4]

void zypp::VendorAttr::addVendorList | ( | const VendorList & | list_r | ) |
| inline

Definition at line 108 of file VendorAttr.h.

## ◆ addVendorList() [3/4]

template<class TContainer>

void zypp::VendorAttr::addVendorList | ( | const TContainer & | container_r | ) |
| inline

Definition at line 112 of file VendorAttr.h.

## ◆ addVendorList() [4/4]

template<class TStr>

void zypp::VendorAttr::addVendorList | ( | const std::initializer_list< TStr > & | container_r | ) |
| inline

Definition at line 121 of file VendorAttr.h.

## ◆ equivalent() [1/4]

bool zypp::VendorAttr::equivalent | ( | const Vendor & | lVendor,
|  | const Vendor & | rVendor ) const

Return whether two vendor strings should be treated as the same vendor.

Usually the solver is allowed to automatically select a package of an equivalent vendor when updating. Replacing a package with one of a different vendor usually must be confirmed by the user.

Definition at line 313 of file VendorAttr.cc.

## ◆ equivalent() [2/4]

bool zypp::VendorAttr::equivalent | ( | IdString | lVendor,
|  | IdString | rVendor ) const

Definition at line 310 of file VendorAttr.cc.

## ◆ equivalent() [3/4]

bool zypp::VendorAttr::equivalent | ( | sat::Solvable | lVendor,
|  | sat::Solvable | rVendor ) const

Definition at line 316 of file VendorAttr.cc.

## ◆ equivalent() [4/4]

bool zypp::VendorAttr::equivalent | ( | const PoolItem & | lVendor,
|  | const PoolItem & | rVendor ) const

Definition at line 319 of file VendorAttr.cc.

## ◆ relaxedEquivalent() [1/4]

bool zypp::VendorAttr::relaxedEquivalent | ( | const Vendor & | lVendor,
|  | const Vendor & | rVendor ) const

Like equivalent but always unifies suse and openSUSE vendor.

Definition at line 326 of file VendorAttr.cc.

## ◆ relaxedEquivalent() [2/4]

bool zypp::VendorAttr::relaxedEquivalent | ( | IdString | lVendor,
|  | IdString | rVendor ) const

Definition at line 323 of file VendorAttr.cc.

## ◆ relaxedEquivalent() [3/4]

bool zypp::VendorAttr::relaxedEquivalent | ( | sat::Solvable | lVendor,
|  | sat::Solvable | rVendor ) const

Definition at line 329 of file VendorAttr.cc.

## ◆ relaxedEquivalent() [4/4]

bool zypp::VendorAttr::relaxedEquivalent | ( | const PoolItem & | lVendor,
|  | const PoolItem & | rVendor ) const

Definition at line 332 of file VendorAttr.cc.

## ◆ foreachVendorList()

unsigned zypp::VendorAttr::foreachVendorList | ( | std::function< bool(VendorList)> | fnc_r | ) | const

Call fnc_r for each equivalent vendor list (return `false` to break).

Returns
  The number of calls to fnc_r.

Definition at line 303 of file VendorAttr.cc.

## ◆ _addVendorList()

void zypp::VendorAttr::_addVendorList | ( | VendorList && | list_r | ) |

Definition at line 300 of file VendorAttr.cc.

## Friends And Related Symbol Documentation

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | str,
|  | const VendorAttr & | obj )
| friend

relates: VendorAttr Stream output

Definition at line 337 of file VendorAttr.cc.

## Member Data Documentation

## ◆ _pimpl

RWCOW_pointer<Impl> zypp::VendorAttr::_pimpl

Implementation class.

Pointer to implementation.

Definition at line 159 of file VendorAttr.h.

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

- zypp/VendorAttr.h
- zypp/VendorAttr.cc