zypp::target::TargetImpl Class Reference

Base class for concrete Target implementations. More...

#include <TargetImpl.h>

Inheritance diagram for zypp::target::TargetImpl:

zypp::base::ReferenceCounted NonCopyable List of all members.

Public Types

typedef std::list< PoolItem_RefPoolItemList
 list of pool items
typedef std::set< PoolItem_RefPoolItemSet
 set of pool items

Public Member Functions

void getResolvablesToInsDel (const ResPool pool_r, PoolItemList &dellist_r, PoolItemList &instlist_r, PoolItemList &srclist_r) const
 Sort according to prereqs and media numbers.
 TargetImpl (const Pathname &root_r="/")
 Ctor.
virtual ~TargetImpl ()
 Dtor.
const ResStoreresolvables ()
 All resolvables in the target.
ResStore::resfilter_const_iterator byKindBegin (const ResObject::Kind &kind_r) const
 load resolvables of certain kind in the internal store and return a iterator successive calls will be faster as resolvables are cached-
ResStore::resfilter_const_iterator byKindEnd (const ResObject::Kind &kind_r) const
Pathname root () const
 The root set for this target.
ZYppCommitResult commit (ResPool pool_r, const ZYppCommitPolicy &policy_r)
 Commit changes in the pool.
ZYPP_DEPRECATED int commit (ResPool pool_r, unsigned int medianr, PoolItemList &errors_r, PoolItemList &remaining_r, PoolItemList &srcremaining_r, bool dry_run=false)
bool isStorageEnabled () const
 enables the storage target
void enableStorage (const Pathname &root_r)
PoolItemList commit (const PoolItemList &items_r, const ZYppCommitPolicy &policy_r, const ResPool &pool_r)
 Commit ordered changes.
virtual std::ostream & dumpOn (std::ostream &str) const
 Overload to realize stream output.
rpm::RpmDbrpm ()
 The RPM database.
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().
ResObject::constPtr whoOwnsFile (const std::string &path_str) const
 Return the resolvable which provides path_str (rpm -qf) return NULL if no resolvable provides this file.
bool setInstallationLogfile (const Pathname &path_r)
 Set the log file for target.
Date timestamp () const
 return the last modification date of the target
void reset ()
 reload the target in future calls if needed.

Static Public Member Functions

static TargetImpl_Ptr nullimpl ()
 Null implementation.

Protected Member Functions

void loadKindResolvables (const Resolvable::Kind kind)

Protected Attributes

ResStore _store
 All resolvables provided by the target.
Pathname _root
 Path to the target.
rpm::RpmDb _rpm
 RPM database.
zypp::storage::PersistentStorage _storage
bool _storage_enabled
std::map< const Resolvable::Kind,
DefaultFalseBool
_resstore_loaded

Static Private Attributes

static TargetImpl_Ptr _nullimpl
 Null implementation.

Friends

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

Detailed Description

Base class for concrete Target implementations.

Constructed by TargetFactory. Public access via Target interface.

Definition at line 52 of file TargetImpl.h.


Member Typedef Documentation

typedef std::list<PoolItem_Ref> zypp::target::TargetImpl::PoolItemList

list of pool items

Definition at line 58 of file TargetImpl.h.

typedef std::set<PoolItem_Ref> zypp::target::TargetImpl::PoolItemSet

set of pool items

Definition at line 61 of file TargetImpl.h.


Constructor & Destructor Documentation

zypp::target::TargetImpl::TargetImpl ( const Pathname &  root_r = "/"  ) 

Ctor.

Definition at line 234 of file TargetImpl.cc.

References _root, _rpm, zypp::target::rpm::RpmDb::initDatabase(), and MIL.

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

Dtor.

Definition at line 246 of file TargetImpl.cc.

References _rpm, zypp::target::rpm::RpmDb::closeDatabase(), and MIL.


Member Function Documentation

void zypp::target::TargetImpl::getResolvablesToInsDel ( const ResPool  pool_r,
PoolItemList dellist_r,
PoolItemList instlist_r,
PoolItemList srclist_r 
) const

Sort according to prereqs and media numbers.

Definition at line 736 of file TargetImpl.cc.

References zypp::pool::GetResolvablesToInsDel::_toDelete, zypp::pool::GetResolvablesToInsDel::_toInstall, zypp::pool::GetResolvablesToInsDel::_toSrcinstall, and MIL.

TargetImpl_Ptr zypp::target::TargetImpl::nullimpl (  )  [static]

Null implementation.

Definition at line 221 of file TargetImpl.cc.

References _nullimpl.

Referenced by zypp::Target::nullimpl().

const ResStore & zypp::target::TargetImpl::resolvables (  ) 

All resolvables in the target.

Definition at line 323 of file TargetImpl.cc.

References _store, and loadKindResolvables().

Referenced by loadKindResolvables().

ResStore::resfilter_const_iterator zypp::target::TargetImpl::byKindBegin ( const ResObject::Kind kind_r  )  const

load resolvables of certain kind in the internal store and return a iterator successive calls will be faster as resolvables are cached-

Definition at line 307 of file TargetImpl.cc.

References _store, zypp::ResStore::begin(), zypp::ResStore::end(), and loadKindResolvables().

ResStore::resfilter_const_iterator zypp::target::TargetImpl::byKindEnd ( const ResObject::Kind kind_r  )  const

Definition at line 315 of file TargetImpl.cc.

References _store, zypp::ResStore::end(), and loadKindResolvables().

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

The root set for this target.

Definition at line 264 of file TargetImpl.cc.

References _root.

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

Commit changes in the pool.

Definition at line 346 of file TargetImpl.cc.

References zypp::ZYppCommitResult::_remaining, zypp::ZYppCommitResult::_result, zypp::ZYppCommitResult::_srcremaining, zypp::ZYppCommitPolicy::allMedia(), MIL, zypp::pool::GetResolvablesToInsDel::ORDER_BY_MEDIANR, zypp::pool::GetResolvablesToInsDel::ORDER_BY_SOURCE, zypp::ZYppCommitPolicy::restrictToMedia(), and XXX.

Referenced by commit().

ZYPP_DEPRECATED int zypp::target::TargetImpl::commit ( ResPool  pool_r,
unsigned int  medianr,
PoolItemList errors_r,
PoolItemList remaining_r,
PoolItemList srcremaining_r,
bool  dry_run = false 
) [inline]

Definition at line 100 of file TargetImpl.h.

References zypp::ZYppCommitResult::_errors, zypp::ZYppCommitResult::_remaining, zypp::ZYppCommitResult::_result, zypp::ZYppCommitResult::_srcremaining, commit(), and zypp::ZYppCommitPolicy::restrictToMedia().

bool zypp::target::TargetImpl::isStorageEnabled (  )  const

enables the storage target

Definition at line 252 of file TargetImpl.cc.

References _storage_enabled.

Referenced by commit(), loadKindResolvables(), and timestamp().

void zypp::target::TargetImpl::enableStorage ( const Pathname &  root_r  ) 

Definition at line 258 of file TargetImpl.cc.

References _storage, _storage_enabled, and zypp::storage::PersistentStorage::init().

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

Commit ordered changes.

Parameters:
pool_r only needed for #160792
Returns:
uncommitted ones (due to error)

Definition at line 438 of file TargetImpl.cc.

References _rpm, _storage, DBG, zypp::storage::PersistentStorage::deleteObject(), zypp::ZYppCommitPolicy::dryRun(), zypp::target::ExecuteDoScript(), zypp::target::ExecuteUndoScript(), zypp::target::rpm::RpmDb::installPackage(), isStorageEnabled(), MIL, N_, zypp::target::obsoleteMatchesFromStorage(), zypp::source::PackageProvider::providePackage(), zypp::source::PackageProviderPolicy::queryInstalledCB(), zypp::Source_Ref::release(), zypp::target::rpm::RpmDb::removePackage(), report, zypp::PoolItem_Ref::resolvable(), rpm(), zypp::target::rpm::InstallResolvableReport::RPM, zypp::target::rpm::InstallResolvableReport::RPM_NODEPS, zypp::target::rpm::InstallResolvableReport::RPM_NODEPS_FORCE, zypp::target::rpm::RpmDb::RPMINST_FORCE, zypp::target::rpm::RpmDb::RPMINST_NODEPS, zypp::target::rpm::RpmDb::RPMINST_NOSIGNATURE, zypp::target::rpm::RpmDb::RPMINST_NOUPGRADE, zypp::target::rpm::RpmDb::RPMINST_TEST, zypp::ZYppCommitPolicy::rpmNoSignature(), zypp::ResStatus::USER, WAR, ZYPP_CAUGHT, and ZYPP_THROW.

virtual std::ostream& zypp::target::TargetImpl::dumpOn ( std::ostream &  str  )  const [inline, virtual]

Overload to realize stream output.

Reimplemented from zypp::base::ReferenceCounted.

Definition at line 126 of file TargetImpl.h.

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

The RPM database.

Definition at line 700 of file TargetImpl.cc.

References _rpm.

Referenced by commit().

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 705 of file TargetImpl.cc.

References _rpm, and zypp::target::rpm::RpmDb::hasFile().

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

Return the resolvable which provides path_str (rpm -qf) return NULL if no resolvable provides this file.

Definition at line 712 of file TargetImpl.cc.

References _rpm, _store, zypp::ResStore::begin(), zypp::ResStore::end(), name, and zypp::target::rpm::RpmDb::whoOwnsFile().

bool zypp::target::TargetImpl::setInstallationLogfile ( const Pathname &  path_r  ) 

Set the log file for target.

Definition at line 729 of file TargetImpl.cc.

References zypp::target::CommitLog::setFname().

Date zypp::target::TargetImpl::timestamp (  )  const

return the last modification date of the target

Definition at line 748 of file TargetImpl.cc.

References _rpm, _storage, isStorageEnabled(), zypp::Date::now(), zypp::storage::PersistentStorage::timestamp(), and zypp::target::rpm::RpmDb::timestamp().

void zypp::target::TargetImpl::reset (  ) 

reload the target in future calls if needed.

note the loading can actually be delayed, but the next call to resolvables must reflect the status of the system.

Definition at line 334 of file TargetImpl.cc.

References _resstore_loaded, _store, and zypp::ResStore::clear().

void zypp::target::TargetImpl::loadKindResolvables ( const Resolvable::Kind  kind  )  [protected]

Definition at line 269 of file TargetImpl.cc.

References _resstore_loaded, _rpm, _storage, _store, zypp::target::rpm::RpmDb::getPackages(), zypp::ResStore::insert(), isStorageEnabled(), resolvables(), zypp::storage::PersistentStorage::storedObjects(), and WAR.

Referenced by byKindBegin(), byKindEnd(), and resolvables().


Friends And Related Function Documentation

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

Stream output.

Definition at line 177 of file TargetImpl.h.


Member Data Documentation

ResStore zypp::target::TargetImpl::_store [protected]

All resolvables provided by the target.

Definition at line 160 of file TargetImpl.h.

Referenced by byKindBegin(), byKindEnd(), loadKindResolvables(), reset(), resolvables(), and whoOwnsFile().

Pathname zypp::target::TargetImpl::_root [protected]

Path to the target.

Definition at line 162 of file TargetImpl.h.

Referenced by root(), and TargetImpl().

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

RPM database.

Definition at line 164 of file TargetImpl.h.

Referenced by commit(), loadKindResolvables(), providesFile(), rpm(), TargetImpl(), timestamp(), whoOwnsFile(), and ~TargetImpl().

zypp::storage::PersistentStorage zypp::target::TargetImpl::_storage [protected]

Definition at line 166 of file TargetImpl.h.

Referenced by commit(), enableStorage(), loadKindResolvables(), and timestamp().

bool zypp::target::TargetImpl::_storage_enabled [protected]

Definition at line 167 of file TargetImpl.h.

Referenced by enableStorage(), and isStorageEnabled().

std::map< const Resolvable::Kind, DefaultFalseBool> zypp::target::TargetImpl::_resstore_loaded [protected]

Definition at line 168 of file TargetImpl.h.

Referenced by loadKindResolvables(), and reset().

TargetImpl_Ptr zypp::target::TargetImpl::_nullimpl [static, private]

Null implementation.

Definition at line 172 of file TargetImpl.h.

Referenced by nullimpl().


The documentation for this class was generated from the following files:
Generated on Tue Nov 28 16:49:41 2006 for zypp by  doxygen 1.5.0