zypp::target::TargetImpl Class Reference

Base class for concrete Target implementations. More...

#include <TargetImpl.h>

Inheritance diagram for zypp::target::TargetImpl:
[legend]

List of all members.

Public Types

typedef std::list
< PoolItem_Ref
PoolItemList
 list of pool items
typedef std::set
< PoolItem_Ref
PoolItemSet
 set of pool items

Public Member Functions

 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.
void installSrcPackage (const SrcPackage_constPtr &srcPackage_r)
 Install a source package on the Target.
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 273 of file TargetImpl.cc.

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

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

Dtor.

Definition at line 285 of file TargetImpl.cc.

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


Member Function Documentation

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

Null implementation.

Definition at line 261 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 362 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 346 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 354 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 303 of file TargetImpl.cc.

References _root.

Referenced by commit().

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

Commit changes in the pool.

Definition at line 385 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 91 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 291 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 297 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 477 of file TargetImpl.cc.

References _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::target::rpm::RpmDb::removePackage(), report, zypp::PoolItem_Ref::resolvable(), root(), rpm(), 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::storage::PersistentStorage::storeObject(), zypp::ResStatus::USER, WAR, ZYPP_CAUGHT, and ZYPP_THROW.

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

Install a source package on the Target.

Definition at line 771 of file TargetImpl.cc.

References zypp::target::rpm::RpmDb::installPackage(), zypp::repo::SrcPackageProvider::provideSrcPackage(), and rpm().

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 120 of file TargetImpl.h.

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

The RPM database.

Definition at line 708 of file TargetImpl.cc.

References _rpm.

Referenced by commit(), and installSrcPackage().

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

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

Definition at line 720 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 737 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 743 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 373 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 308 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 171 of file TargetImpl.h.


Member Data Documentation

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

All resolvables provided by the target.

Definition at line 154 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 156 of file TargetImpl.h.

Referenced by root(), and TargetImpl().

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

RPM database.

Definition at line 158 of file TargetImpl.h.

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

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

Definition at line 160 of file TargetImpl.h.

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

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

Definition at line 161 of file TargetImpl.h.

Referenced by enableStorage(), and isStorageEnabled().

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

Definition at line 162 of file TargetImpl.h.

Referenced by loadKindResolvables(), and reset().

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

Null implementation.

Definition at line 166 of file TargetImpl.h.

Referenced by nullimpl().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:28 2007 for libzypp by  doxygen 1.5.3