libzypp  17.28.8
zypp::target::TargetImpl Class Reference

Base class for concrete Target implementations. More...

#include <target/TargetImpl.h>

Inheritance diagram for zypp::target::TargetImpl:

Public Types

typedef std::list< PoolItemPoolItemList
 list of pool items More...
 
typedef std::set< PoolItemPoolItemSet
 set of pool items More...
 

Public Member Functions

 TargetImpl (const Pathname &root_r="/", bool doRebuild_r=false)
 Ctor. More...
 
virtual ~TargetImpl ()
 Dtor. More...
 
Pathname root () const
 The root set for this target. More...
 
Pathname home () const
 The directory to store things. More...
 
ZYppCommitResult commit (ResPool pool_r, const ZYppCommitPolicy &policy_r)
 Commit changes in the pool. More...
 
void installSrcPackage (const SrcPackage_constPtr &srcPackage_r)
 Install a source package on the Target. More...
 
ManagedFile provideSrcPackage (const SrcPackage_constPtr &srcPackage_r)
 Provides a source package on the Target. More...
 
virtual std::ostream & dumpOn (std::ostream &str) const
 Overload to realize stream output. More...
 
rpm::RpmDbrpm ()
 The RPM database. More...
 
bool providesFile (const std::string &path_str, const std::string &name_str) const
 If the package is installed and provides the file Needed to evaluate split provides during Resolver::Upgrade() More...
 
std::string whoOwnsFile (const std::string &path_str) const
 Return name of package owning path_str or empty string if no installed package owns path_str. More...
 
Product::constPtr baseProduct () const
 returns the target base installed product, also known as the distribution or platform.
More...
 
LocaleSet requestedLocales () const
 Languages to be supported by the system.
More...
 
void updateAutoInstalled ()
 Update the database of autoinstalled packages.
More...
 
std::string targetDistribution () const
 This is register.target attribute of the installed base product.
More...
 
std::string targetDistributionRelease () const
 This is register.release attribute of the installed base product. More...
 
std::string targetDistributionFlavor () const
 This is register.flavor attribute of the installed base product. More...
 
Target::DistributionLabel distributionLabel () const
 This is shortName and summary attribute of the installed base product. More...
 
std::string distributionVersion () const
 This is version attribute of the installed base product. More...
 
const VendorAttrvendorAttr () const
 The targets current vendor equivalence settings.
More...
 
void vendorAttr (VendorAttr vendorAttr_r)
 
- Public Member Functions inherited from zypp::base::ReferenceCounted
 ReferenceCounted ()
 Default ctor. More...
 
 ReferenceCounted (const ReferenceCounted &rhs)
 Copy ctor. More...
 
virtual ~ReferenceCounted ()
 Dtor. More...
 
ReferenceCountedoperator= (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...
 

Static Public Member Functions

static Pathname home (const Pathname &root_r)
 
static LocaleSet requestedLocales (const Pathname &root_r)
 
static std::string targetDistribution (const Pathname &root_r)
 
static std::string targetDistributionRelease (const Pathname &root_r)
 
static std::string targetDistributionFlavor (const Pathname &root_r)
 
static Target::DistributionLabel distributionLabel (const Pathname &root_r)
 
static std::string distributionVersion (const Pathname &root_r)
 
- 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...
 

Protected Attributes

Pathname _root
 Path to the target. More...
 
rpm::RpmDb _rpm
 RPM database. More...
 
RequestedLocalesFile _requestedLocalesFile
 Requested Locales database. More...
 
SolvIdentFile _autoInstalledFile
 user/auto installed database More...
 
HardLocksFile _hardLocksFile
 Hard-Locks database. More...
 
std::string _distributionVersion
 Cache distributionVersion. More...
 
VendorAttr _vendorAttr
 vendor equivalence settings. More...
 

Private Member Functions

void commit (const ZYppCommitPolicy &policy_r, CommitPackageCache &packageCache_r, ZYppCommitResult &result_r)
 Commit ordered changes (internal helper) More...
 
void commitInSingleTransaction (const ZYppCommitPolicy &policy_r, CommitPackageCache &packageCache_r, ZYppCommitResult &result_r)
 Commit ordered changes (internal helper) More...
 
void commitFindFileConflicts (const ZYppCommitPolicy &policy_r, ZYppCommitResult &result_r)
 Commit helper checking for file conflicts after download. More...
 

Friends

std::ostream & operator<< (std::ostream &str, const TargetImpl &obj)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const TargetImpl &obj)
 

Solv file handling.

If target solv file is outdated, but (non-root-)user has no permission to create it at the default location, we use a temporary one.

Pathname _tmpSolvfilesPath
 
void load (bool force=true)
 
void unload ()
 
void reload ()
 
void clearCache ()
 
bool buildCache ()
 
Pathname defaultSolvfilesPath () const
 The systems default solv file location. More...
 
Pathname solvfilesPath () const
 The solv file location actually in use (default or temp). More...
 
bool solvfilesPathIsTemp () const
 Whether we're using a temp. More...
 

Additional Inherited Members

- 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...
 

Detailed Description

Base class for concrete Target implementations.

Constructed by TargetFactory. Public access via Target interface.

Definition at line 53 of file TargetImpl.h.

Member Typedef Documentation

◆ PoolItemList

list of pool items

Definition at line 59 of file TargetImpl.h.

◆ PoolItemSet

set of pool items

Definition at line 62 of file TargetImpl.h.

Constructor & Destructor Documentation

◆ TargetImpl()

zypp::target::TargetImpl::TargetImpl ( const Pathname root_r = "/",
bool  doRebuild_r = false 
)

Ctor.

Definition at line 816 of file TargetImpl.cc.

◆ ~TargetImpl()

zypp::target::TargetImpl::~TargetImpl ( )
virtual

Dtor.

Definition at line 949 of file TargetImpl.cc.

Member Function Documentation

◆ defaultSolvfilesPath()

Pathname zypp::target::TargetImpl::defaultSolvfilesPath ( ) const
private

The systems default solv file location.

Definition at line 962 of file TargetImpl.cc.

◆ solvfilesPath()

Pathname zypp::target::TargetImpl::solvfilesPath ( ) const
inlineprivate

The solv file location actually in use (default or temp).

Definition at line 94 of file TargetImpl.h.

◆ solvfilesPathIsTemp()

bool zypp::target::TargetImpl::solvfilesPathIsTemp ( ) const
inlineprivate

Whether we're using a temp.

solvfile.

Definition at line 98 of file TargetImpl.h.

◆ load()

void zypp::target::TargetImpl::load ( bool  force = true)

Definition at line 1130 of file TargetImpl.cc.

◆ unload()

void zypp::target::TargetImpl::unload ( )

Definition at line 1123 of file TargetImpl.cc.

◆ reload()

void zypp::target::TargetImpl::reload ( )

Definition at line 1118 of file TargetImpl.cc.

◆ clearCache()

void zypp::target::TargetImpl::clearCache ( )

Definition at line 967 of file TargetImpl.cc.

◆ buildCache()

bool zypp::target::TargetImpl::buildCache ( )

Definition at line 973 of file TargetImpl.cc.

◆ root()

Pathname zypp::target::TargetImpl::root ( ) const
inline

The root set for this target.

Definition at line 118 of file TargetImpl.h.

◆ home() [1/2]

Pathname zypp::target::TargetImpl::home ( ) const
inline

The directory to store things.

Definition at line 122 of file TargetImpl.h.

◆ home() [2/2]

static Pathname zypp::target::TargetImpl::home ( const Pathname root_r)
inlinestatic

Definition at line 125 of file TargetImpl.h.

◆ commit() [1/2]

ZYppCommitResult zypp::target::TargetImpl::commit ( ResPool  pool_r,
const ZYppCommitPolicy policy_r 
)

Commit changes in the pool.

Definition at line 1270 of file TargetImpl.cc.

◆ installSrcPackage()

void zypp::target::TargetImpl::installSrcPackage ( const SrcPackage_constPtr &  srcPackage_r)

Install a source package on the Target.

Definition at line 2967 of file TargetImpl.cc.

◆ provideSrcPackage()

ManagedFile zypp::target::TargetImpl::provideSrcPackage ( const SrcPackage_constPtr &  srcPackage_r)

Provides a source package on the Target.

Definition at line 2978 of file TargetImpl.cc.

◆ dumpOn()

virtual std::ostream& zypp::target::TargetImpl::dumpOn ( std::ostream &  str) const
inlinevirtual

Overload to realize stream output.

Reimplemented from zypp::base::ReferenceCounted.

Definition at line 138 of file TargetImpl.h.

◆ rpm()

rpm::RpmDb & zypp::target::TargetImpl::rpm ( )

The RPM database.

Definition at line 2750 of file TargetImpl.cc.

◆ providesFile()

bool zypp::target::TargetImpl::providesFile ( const std::string &  path_str,
const std::string &  name_str 
) const

If the package is installed and provides the file Needed to evaluate split provides during Resolver::Upgrade()

Definition at line 2755 of file TargetImpl.cc.

◆ whoOwnsFile()

std::string zypp::target::TargetImpl::whoOwnsFile ( const std::string &  path_str) const
inline

Return name of package owning path_str or empty string if no installed package owns path_str.

Definition at line 152 of file TargetImpl.h.

◆ baseProduct()

Product::constPtr zypp::target::TargetImpl::baseProduct ( ) const

returns the target base installed product, also known as the distribution or platform.

returns 0 if there is no base installed product in the pool.

Note
this method requires the target to be loaded, otherwise it will return 0 as no product is found.

if you require some base product attributes when the target is not loaded into the pool, see targetDistribution , targetDistributionRelease and distributionVersion that obtain the data on demand from the installed product information.

Definition at line 2813 of file TargetImpl.cc.

◆ requestedLocales() [1/2]

LocaleSet zypp::target::TargetImpl::requestedLocales ( ) const
inline

Languages to be supported by the system.

E.g. language specific packages to be installed.

Definition at line 159 of file TargetImpl.h.

◆ requestedLocales() [2/2]

LocaleSet zypp::target::TargetImpl::requestedLocales ( const Pathname root_r)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 2825 of file TargetImpl.cc.

◆ updateAutoInstalled()

void zypp::target::TargetImpl::updateAutoInstalled ( )

Update the database of autoinstalled packages.

This is done on commit, so you usually don't need to call this explicitly.

Definition at line 2834 of file TargetImpl.cc.

◆ targetDistribution() [1/2]

std::string zypp::target::TargetImpl::targetDistribution ( ) const

This is register.target attribute of the installed base product.

Used for registration and Service refresh.

Definition at line 2843 of file TargetImpl.cc.

◆ targetDistribution() [2/2]

std::string zypp::target::TargetImpl::targetDistribution ( const Pathname root_r)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 2846 of file TargetImpl.cc.

◆ targetDistributionRelease() [1/2]

std::string zypp::target::TargetImpl::targetDistributionRelease ( ) const

This is register.release attribute of the installed base product.

Used for registration.

Definition at line 2849 of file TargetImpl.cc.

◆ targetDistributionRelease() [2/2]

std::string zypp::target::TargetImpl::targetDistributionRelease ( const Pathname root_r)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 2852 of file TargetImpl.cc.

◆ targetDistributionFlavor() [1/2]

std::string zypp::target::TargetImpl::targetDistributionFlavor ( ) const

This is register.flavor attribute of the installed base product.

Used for registration.

Note
don't mistake this for distributionFlavor

Definition at line 2855 of file TargetImpl.cc.

◆ targetDistributionFlavor() [2/2]

std::string zypp::target::TargetImpl::targetDistributionFlavor ( const Pathname root_r)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 2858 of file TargetImpl.cc.

◆ distributionLabel() [1/2]

Target::DistributionLabel zypp::target::TargetImpl::distributionLabel ( ) const

This is shortName and summary attribute of the installed base product.

Used e.g. for the bootloader menu.

Definition at line 2861 of file TargetImpl.cc.

◆ distributionLabel() [2/2]

Target::DistributionLabel zypp::target::TargetImpl::distributionLabel ( const Pathname root_r)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 2870 of file TargetImpl.cc.

◆ distributionVersion() [1/2]

std::string zypp::target::TargetImpl::distributionVersion ( ) const

This is version attribute of the installed base product.

For example http://download.opensue.org/update/11.0 The 11.0 corresponds to the base product version.

Definition at line 2879 of file TargetImpl.cc.

◆ distributionVersion() [2/2]

std::string zypp::target::TargetImpl::distributionVersion ( const Pathname root_r)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 2890 of file TargetImpl.cc.

◆ vendorAttr() [1/2]

const VendorAttr& zypp::target::TargetImpl::vendorAttr ( ) const
inline

The targets current vendor equivalence settings.

Initialized from the targets /etc/zypp/vendors.d.

Definition at line 205 of file TargetImpl.h.

◆ vendorAttr() [2/2]

void zypp::target::TargetImpl::vendorAttr ( VendorAttr  vendorAttr_r)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 2960 of file TargetImpl.cc.

◆ commit() [2/2]

void zypp::target::TargetImpl::commit ( const ZYppCommitPolicy policy_r,
CommitPackageCache packageCache_r,
ZYppCommitResult result_r 
)
private

Commit ordered changes (internal helper)

Definition at line 1572 of file TargetImpl.cc.

◆ commitInSingleTransaction()

void zypp::target::TargetImpl::commitInSingleTransaction ( const ZYppCommitPolicy policy_r,
CommitPackageCache packageCache_r,
ZYppCommitResult result_r 
)
private

Commit ordered changes (internal helper)

Definition at line 1868 of file TargetImpl.cc.

◆ commitFindFileConflicts()

void zypp::target::TargetImpl::commitFindFileConflicts ( const ZYppCommitPolicy policy_r,
ZYppCommitResult result_r 
)
private

Commit helper checking for file conflicts after download.

Definition at line 122 of file TargetImpl.commitFindFileConflicts.cc.

Friends And Related Function Documentation

◆ operator<< [1/2]

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

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  str,
const TargetImpl obj 
)
related

Stream output

Definition at line 245 of file TargetImpl.h.

Member Data Documentation

◆ _tmpSolvfilesPath

Pathname zypp::target::TargetImpl::_tmpSolvfilesPath
private

Definition at line 101 of file TargetImpl.h.

◆ _root

Pathname zypp::target::TargetImpl::_root
protected

Path to the target.

Definition at line 228 of file TargetImpl.h.

◆ _rpm

rpm::RpmDb zypp::target::TargetImpl::_rpm
protected

RPM database.

Definition at line 230 of file TargetImpl.h.

◆ _requestedLocalesFile

RequestedLocalesFile zypp::target::TargetImpl::_requestedLocalesFile
protected

Requested Locales database.

Definition at line 232 of file TargetImpl.h.

◆ _autoInstalledFile

SolvIdentFile zypp::target::TargetImpl::_autoInstalledFile
protected

user/auto installed database

Definition at line 234 of file TargetImpl.h.

◆ _hardLocksFile

HardLocksFile zypp::target::TargetImpl::_hardLocksFile
protected

Hard-Locks database.

Definition at line 236 of file TargetImpl.h.

◆ _distributionVersion

std::string zypp::target::TargetImpl::_distributionVersion
mutableprotected

Cache distributionVersion.

Definition at line 238 of file TargetImpl.h.

◆ _vendorAttr

VendorAttr zypp::target::TargetImpl::_vendorAttr
protected

vendor equivalence settings.

Definition at line 240 of file TargetImpl.h.


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