Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

InstTarget Class Reference

#include <InstTarget.h>

Inheritance diagram for InstTarget:

CountedRep InstData Rep List of all members.

Public Types

typedef InstTargetError Error
typedef enum RpmDb::RpmInstFlag InstFlag
typedef enum RpmDb::checkPackageResult checkPackageResult

Public Member Functions

const Pathnamerootdir () const
bool initialized () const
bool needsUpdate () const
PMError bringIntoCleanState ()
virtual const std::list< PMPackagePtr > & getPackages () const
virtual const std::vector<
PMYouPatchPtr > & 
getPatches () const
bool setInstallationLogfile (const std::string &logfile)
void setBackupPath (const Pathname &path)
void createPackageBackups (bool yes)
Pathname getBackupPath (void)
void setPkgInstFlags (unsigned flags)
unsigned getPkgInstFlags () const
void setPkgRemoveFlags (unsigned flags)
unsigned getPkgRemoveFlags () const
PMError installPackage (const Pathname &filename, unsigned flags=0)
PMError installPackages (const std::list< Pathname > &filenames, unsigned flags=0)
PMError removePackage (const std::string &name_r, unsigned flags=0)
PMError removePackage (constPMPackagePtr package, unsigned flags=0)
PMError removePackages (const std::list< std::string > &names_r, unsigned flags=0)
PMError removePackages (const std::list< PMPackagePtr > &packages, unsigned flags=0)
PMError importPubkey (const Pathname &pubkey_r)
PMError importPubkey (const Pathname &keyring_r, const std::string &keyname_r)
std::set< PkgEditionpubkeys () const
bool hasFile (const std::string &file_r) const
bool hasProvides (const std::string &tag_r) const
bool hasRequiredBy (const std::string &tag_r) const
bool hasConflicts (const std::string &tag_r) const
bool hasPackage (const PkgName &name_r) const
void traceFileRel (const PkgRelation &rel_r)
bool isProvided (const std::string &tag)
bool isInstalled (const std::string &name)
PMError installPatch (const Pathname &filename)
PMError executeScript (const Pathname &scriptname)
PMError executeScript (const Pathname &scriptname, const std::list< std::string > arguments)
bool mayAccessProducts () const
const std::list< constInstSrcDescrPtr > & getProducts () const
bool isInstalledProduct (const constInstSrcDescrPtr &isd_r) const
PMError installProduct (const constInstSrcDescrPtr &isd_r)
PMError removeProduct (const constInstSrcDescrPtr &isd_r)
bool mayAccessSelections () const
virtual const std::list< PMSelectionPtr > & getSelections () const
bool isInstalledSelection (const Pathname &selfile_r) const
PMError installSelection (const Pathname &selfile_r)
PMError removeSelection (const Pathname &selfile_r)
std::set< PkgDuMaster::MountPointgetMountPoints () const

Static Public Member Functions

PkgArch baseArch ()

Private Member Functions

 REP_BODY (InstTarget)
 InstTarget ()
 ~InstTarget ()
PMError init (const Pathname &rootpath)

Private Attributes

Pathname _rootdir
RpmDbPtr _rpmdb
InstTargetProdDBPtr _proddb
InstTargetSelDBPtr _seldb
unsigned _rpminstflags
unsigned _rpmremoveflags
std::vector< PMYouPatchPtr > _patches
bool _patchesInitialized

Member Typedef Documentation

typedef enum RpmDb::checkPackageResult InstTarget::checkPackageResult
 

Bits of possible package corruptions Has to be moved from RpmDB to here

See also:
RpmDb::checkPackageResult

typedef class InstTargetError InstTarget::Error
 

Default error class

typedef enum RpmDb::RpmInstFlag InstTarget::InstFlag
 

Installation options like force, nodeps ... Has to be moved from RpmDB to here

See also:
RpmDB::RpmInstFlag


Constructor & Destructor Documentation

InstTarget::InstTarget  )  [private]
 

InstTarget::~InstTarget  )  [private]
 


Member Function Documentation

PkgArch InstTarget::baseArch  )  [static]
 

Determine target system architecture.

PMError InstTarget::bringIntoCleanState  ) 
 

bring target into a clean state e.g. by calling rpm --rebuilddb

void InstTarget::createPackageBackups bool  yes  ) 
 

whether to create package backups during install or removal

Parameters:
yes true or false

PMError InstTarget::executeScript const Pathname scriptname,
const std::list< std::string >  arguments
 

PMError InstTarget::executeScript const Pathname scriptname  ) 
 

Execute script.

Pathname InstTarget::getBackupPath void   ) 
 

get backup dir for rpm config files

std::set< PkgDuMaster::MountPoint > InstTarget::getMountPoints  )  const
 

Fallback for Packagemanager in case no one initialized the 'df' info for disk usage calculation. Returns an empty set if _rootdir is not yet set.

/proc/mounts
FilesystemMounted onTypeOptions  
rootfs/rootfsrw00
/dev/root/reiserfsrw00
proc/procprocrw00
devpts/dev/ptsdevptsrw00
/dev/hda5/bootext2rw00
shmfs/dev/shmshmrw00
usbdevfs/proc/bus/usbusbdevfsrw00
automount(pid3743)/suseautofsrw00
wotan:/real-home/ma/suse/manfsrw,nosuid,v2,rsize=8192,wsize=8192,hard,intr,udp,nolock,addr=wotan00

Taken into account are entries,

  • whose filesystem contains a '/'
  • whose mountpoint is at or below the current _rootdir

const std::list< PMPackagePtr > & InstTarget::getPackages  )  const [virtual]
 

generate PMPackage objects for each Item on the source/target

Returns:
list of PMPackagePtr on this source

Implements InstData.

const std::vector< PMYouPatchPtr > & InstTarget::getPatches  )  const [virtual]
 

generate PMYouPatch objects for each patch on the source

Returns:
list of PMYouPatchPtr on this source

Implements InstData.

unsigned InstTarget::getPkgInstFlags  )  const
 

get current package installation parameters get 'rpm' parameters currently used for package installation

unsigned InstTarget::getPkgRemoveFlags  )  const
 

get current package removal parameters get 'rpm' parameters currently used for package removal

const std::list< constInstSrcDescrPtr > & InstTarget::getProducts  )  const
 

Return list of installed Products (reverse sorted by installation time).

const list< PMSelectionPtr > & InstTarget::getSelections  )  const [virtual]
 

generate PMSelection objects for each selection on the source

Returns:
list of PMSelectionPtr on this source

Implements InstData.

bool InstTarget::hasConflicts const std::string &  tag_r  )  const [inline]
 

Return true if at least one package conflicts with a certain tag.

bool InstTarget::hasFile const std::string &  file_r  )  const [inline]
 

Return true if at least one package owns a certain file.

bool InstTarget::hasPackage const PkgName name_r  )  const [inline]
 

Return true if package is installed.

bool InstTarget::hasProvides const std::string &  tag_r  )  const [inline]
 

Return true if at least one package provides a certain tag.

bool InstTarget::hasRequiredBy const std::string &  tag_r  )  const [inline]
 

Return true if at least one package requires a certain tag.

PMError InstTarget::importPubkey const Pathname keyring_r,
const std::string &  keyname_r
[inline]
 

Import ascii armored public key keyname_r exported by keyring_r into RPM database

PMError InstTarget::importPubkey const Pathname pubkey_r  )  [inline]
 

Import ascii armored public key in file pubkey_r into RPM database

PMError InstTarget::init const Pathname rootpath  )  [private]
 

Initialize target system. Takes necessary action to make installation, queries etc possible.

Parameters:
rootpath,path to root ("/") of target system Usually "/" if the InstTarget object is actually running inside the target. But might be "/mnt" during installation (running in inst-sys) or "/whatever" if installing into a directory

bool InstTarget::initialized  )  const [inline]
 

Returns:
Whether the target is initialized.

PMError InstTarget::installPackage const Pathname filename,
unsigned  flags = 0
 

install single Package to the target

Parameters:
filename filename of package to install
flags which flags to use, default flags are used if 0

PMError InstTarget::installPackages const std::list< Pathname > &  filenames,
unsigned  flags = 0
 

install multiple packages to the target

Parameters:
filename list of filenames of packages to install
flags which flags to use, default flags are used if 0

PMError InstTarget::installPatch const Pathname filename  ) 
 

Install patch. This function does not install any packages. It just registers the patch as installed.

Parameters:
filename Filename of patch to be installed.

PMError InstTarget::installProduct const constInstSrcDescrPtr &  isd_r  ) 
 

Install Product. That's nothing but copying the InstSrcDescr into the local ProductDB, and remove entries with the same product name but different version than isd_r.

PMError InstTarget::installSelection const Pathname selfile_r  ) 
 

Install Selection. That's nothing but copying the Selection file into the local SelectionDB.

bool InstTarget::isInstalled const std::string &  name  )  [inline]
 

Deprecated old style

bool InstTarget::isInstalledProduct const constInstSrcDescrPtr &  isd_r  )  const
 

Return true if Product isd_r is installed. Actually if an InstSrcDescr with same product name and version is installed.

bool InstTarget::isInstalledSelection const Pathname selfile_r  )  const
 

Return true if Selection selfile_r is installed. Actually only checks whether a file named $(basename selfile_r) is installed.

bool InstTarget::isProvided const std::string &  tag  )  [inline]
 

Deprecated old style

bool InstTarget::mayAccessProducts  )  const
 

Return true if products database is accessible.

bool InstTarget::mayAccessSelections  )  const
 

Return true if selection database is accessible.

bool InstTarget::needsUpdate  )  const
 

Returns:
Whether some data on target changed and should be reread. (e.g. rpm database after install/delete) (NOTE: returns false, if not initialized).

std::set<PkgEdition> InstTarget::pubkeys  )  const [inline]
 

Return the editions of all installed public keys in RPM database.

PMError InstTarget::removePackage constPMPackagePtr  package,
unsigned  flags = 0
 

PMError InstTarget::removePackage const std::string &  name_r,
unsigned  flags = 0
 

remove single package

Parameters:
name_r Name of the rpm package to remove.
flags which flags to use, default flags are used if 0

PMError InstTarget::removePackages const std::list< PMPackagePtr > &  packages,
unsigned  flags = 0
 

PMError InstTarget::removePackages const std::list< std::string > &  names_r,
unsigned  flags = 0
 

remove multiple packages

See also:
removePackage

PMError InstTarget::removeProduct const constInstSrcDescrPtr &  isd_r  ) 
 

Removes Product from ProductDB. I.e. an installed Product with the same product name and version as isd_r.

PMError InstTarget::removeSelection const Pathname selfile_r  ) 
 

Removes a file named $(basename selfile_r) from the SelectionDB.

InstTarget::REP_BODY InstTarget   )  [private]
 

const Pathname& InstTarget::rootdir  )  const [inline]
 

Returns:
The name of the install root. Empty path if not initialized.

void InstTarget::setBackupPath const Pathname path  ) 
 

set backup dir for rpm config files

Parameters:
const Pathname

bool InstTarget::setInstallationLogfile const std::string &  logfile  ) 
 

set log file for installation

Returns:
false if opening the file failed

void InstTarget::setPkgInstFlags unsigned  flags  ) 
 

set parameters to use on installation/update

Parameters:
flags which parameters to use by default, eg. * RPMINST_NODOCS|RPMINST_NOSCRIPTS

void InstTarget::setPkgRemoveFlags unsigned  flags  ) 
 

set parameters to use on removal of packages

Parameters:
flags which parameters to use by default, eg. * RPMINST_FORCE|RPMINST_NODEPS

void InstTarget::traceFileRel const PkgRelation rel_r  )  [inline]
 

Hack to let InstTarget lookup required and conflicting file relations.


Member Data Documentation

std::vector<PMYouPatchPtr> InstTarget::_patches [mutable, private]
 

bool InstTarget::_patchesInitialized [mutable, private]
 

InstTargetProdDBPtr InstTarget::_proddb [private]
 

Products database

Pathname InstTarget::_rootdir [private]
 

The name of the install root.

RpmDbPtr InstTarget::_rpmdb [private]
 

Rpm database

unsigned InstTarget::_rpminstflags [private]
 

parameters to use on installation/update

unsigned InstTarget::_rpmremoveflags [private]
 

parameters to use on removal

InstTargetSelDBPtr InstTarget::_seldb [private]
 

Selection database


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 14:30:32 2007 for yast2-packagemanager by doxygen 1.3.6