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

InstYou Class Reference

#include <InstYou.h>

List of all members.

Public Member Functions

 InstYou ()
 InstYou (const PMYouPatchInfoPtr &, const PMYouSettingsPtr &)
 ~InstYou ()
PMError initProduct ()
PMError servers (std::list< PMYouServer > &)
PMError readUserPassword ()
PMError setUserPassword (const std::string &username, const std::string &password, bool persistent)
PMError retrievePatchDirectory ()
PMError retrievePatchInfo ()
PMError processPatches ()
void selectPatches (int kinds)
void updatePackageStates ()
PMYouSettingsPtr settings () const
PMYouPatchInfoPtr patchInfo () const
PMError removePackages ()
void showPatches (bool verbose=false)
PMError progress (int)
PMError patchProgress (int, const std::string &pkg=std::string())
PMError showError (const std::string &type, const std::string &text, const std::string &details)
PMError showError (const PMError &error)
PMError showMessage (const std::string &type, std::list< PMYouPatchPtr > &)
void log (const std::string &text)
int lastUpdate ()
int installedPatches ()
FSize totalDownloadSize ()
int quickCheckUpdates ()
std::string username () const
std::string password () const
void filterArchitectures (PMYouPatchPtr &patch)

Static Public Member Functions

void setCallbacks (Callbacks *)

Protected Member Functions

PMError attachSource ()
PMError releaseSource ()
void resetProgress ()
bool incrementProgress ()
PMYouPatchPtr firstPatch ()
PMYouPatchPtr nextPatch ()
PMError retrieveCurrentPatch ()
PMError installCurrentPatch ()
PMError disconnect ()
PMError writeLastUpdate ()
PMError installPatches (const vector< PMYouPatchPtr > &)
PMError installPatch (const PMYouPatchPtr &)
PMError retrievePatch (const PMYouPatchPtr &)
PMError retrievePackage (const PMPackagePtr &pkg, const PMYouProductPtr &)
PMError retrieveScript (const std::string &script, const PMYouProductPtr &)
PMError retrieveFile (const PMYouFile &file)
PMError executeScript (const std::string &, const PMYouProductPtr &)
PMError executeScript (const std::string &script, const PMYouProductPtr &product, const std::list< std::string > &arguments)
bool hasOnlyNewPackages (const PMYouPatchPtr &patch)
bool hasNewPackages (const PMYouPatchPtr &patch)
bool isNewerPackage (const PMPackagePtr &pkg)
bool packageToBeInstalled (const PMYouPatchPtr &patch, const PMPackagePtr &pkg)
bool firesPackageTrigger (const PMYouPatchPtr &patch)
bool firesScriptTrigger (const PMYouPatchPtr &patch)
bool hasPatchRpm (const PMPackagePtr &pkg)
PMError verifyMediaNumber (int number, int lastNumber)

Private Member Functions

void init ()

Private Attributes

PMYouPatchInfoPtr _info
PMYouSettingsPtr _settings
std::vector< PMYouPatchPtr > _patches
std::vector< PMYouPatchPtr
>::const_iterator 
_selectedPatchesIt
std::map< std::string, int > _mediaMap
int _progressTotal
int _progressCurrent
MediaAccess _media
std::string _username
std::string _password
FSize _totalDownloadSize
int _installedPatches
int _currentMediaNumber

Static Private Attributes

Callbacks_callbacks = 0


Constructor & Destructor Documentation

InstYou::InstYou  ) 
 

Constructor

InstYou::InstYou const PMYouPatchInfoPtr &  ,
const PMYouSettingsPtr & 
 

Custom constructor

InstYou::~InstYou  ) 
 

Destructor


Member Function Documentation

PMError InstYou::attachSource  )  [protected]
 

Attach source of patches.

PMError InstYou::disconnect  )  [protected]
 

Close connection to server.

PMError InstYou::executeScript const std::string &  script,
const PMYouProductPtr &  product,
const std::list< std::string > &  arguments
[protected]
 

PMError InstYou::executeScript const std::string &  ,
const PMYouProductPtr & 
[protected]
 

void InstYou::filterArchitectures PMYouPatchPtr &  patch  ) 
 

Remove all packages which aren't to be installed because of their architecture.

bool InstYou::firesPackageTrigger const PMYouPatchPtr &  patch  )  [protected]
 

bool InstYou::firesScriptTrigger const PMYouPatchPtr &  patch  )  [protected]
 

PMYouPatchPtr InstYou::firstPatch  )  [protected]
 

Get first selected patch.

bool InstYou::hasNewPackages const PMYouPatchPtr &  patch  )  [protected]
 

Check, if the patch has at least one package which is newer than the instakked version.

bool InstYou::hasOnlyNewPackages const PMYouPatchPtr &  patch  )  [protected]
 

Check, if patch has only packages which are at least as new as the installed version. If the patch contains a package which is older than the installed version or the patch doesn't contain a package which is newer than the installed version false is returned.

Parameters:
requireInstalled if true, it is required that at least one package from the patch is already installed in an older version.

bool InstYou::hasPatchRpm const PMPackagePtr &  pkg  )  [protected]
 

bool InstYou::incrementProgress  )  [protected]
 

void InstYou::init  )  [private]
 

PMError InstYou::initProduct  ) 
 

Init you with product information from installed system.

PMError InstYou::installCurrentPatch  )  [protected]
 

Install next patch in list of selected patches to target system.

int InstYou::installedPatches  )  [inline]
 

Return how many patches have been installed.

PMError InstYou::installPatch const PMYouPatchPtr &   )  [protected]
 

PMError InstYou::installPatches const vector< PMYouPatchPtr > &   )  [protected]
 

bool InstYou::isNewerPackage const PMPackagePtr &  pkg  )  [protected]
 

Check, if package is newer than the installed version. Return false if the package isn't installed yet.

int InstYou::lastUpdate  ) 
 

Returns how many days ago the last update was performed. Returns -1 when no update has occured yet.

void InstYou::log const std::string &  text  ) 
 

Add line to log. Calls callbacks.

PMYouPatchPtr InstYou::nextPatch  )  [protected]
 

bool InstYou::packageToBeInstalled const PMYouPatchPtr &  patch,
const PMPackagePtr &  pkg
[protected]
 

Return if the package is to be installed on the system.

std::string InstYou::password  )  const [inline]
 

PMYouPatchInfoPtr InstYou::patchInfo  )  const [inline]
 

Get object holding patch information.

PMError InstYou::patchProgress int  ,
const std::string &  pkg = std::string()
 

Show YOU patch progress. Calls callbacks.

PMError InstYou::processPatches  ) 
 

Process selected patches. Patches are downloaded or mounted as required and then installed. The settings of the PMYouSettings object are taken into account.

The function uses InstYou::Callbacks to report errors, log progress and handle other events which require information or action from the user.

PMError InstYou::progress int   ) 
 

Show YOU progress. Calls callbacks.

int InstYou::quickCheckUpdates  ) 
 

Check for updates. Returns number of new updates available or -1 on error. Doesn't check for type of updates and doesn't download any update information.

PMError InstYou::readUserPassword  ) 
 

Read user name and password needed for authentification from configuration file.

PMError InstYou::releaseSource  )  [protected]
 

Release source of patches.

PMError InstYou::removePackages  ) 
 

Remove downloaded packages.

void InstYou::resetProgress  )  [protected]
 

PMError InstYou::retrieveCurrentPatch  )  [protected]
 

Download next patch in list of selected patches.

Parameters:
reload If true reload all patch from server.
checkSig If true check signatures of downloaded packages and scripts.

PMError InstYou::retrieveFile const PMYouFile file  )  [protected]
 

PMError InstYou::retrievePackage const PMPackagePtr &  pkg,
const PMYouProductPtr & 
[protected]
 

PMError InstYou::retrievePatch const PMYouPatchPtr &   )  [protected]
 

PMError InstYou::retrievePatchDirectory  ) 
 

Read list of all available patches. The server where the patches are retrieved from has to be set in the paths() object.

PMError InstYou::retrievePatchInfo  ) 
 

Read patch information files. The server where the patches are retrieved from has to be set in the paths() object.

PMError InstYou::retrieveScript const std::string &  script,
const PMYouProductPtr & 
[protected]
 

void InstYou::selectPatches int  kinds  ) 
 

Select Patches.

If there are YaST2 patches, only the newest YaST2 patch will be selected.

If there are no YaST2 patches, all patches will be selected which match the given kind and contain packages which have an older version already installed.

Patches which contain packages which are older than the corresponding installed version will not be selected.

Parameters:
kinds Ored list of kinds to be installed.

PMError InstYou::servers std::list< PMYouServer > &   ) 
 

Get list of patch servers.

void InstYou::setCallbacks Callbacks  )  [static]
 

PMYouSettingsPtr InstYou::settings  )  const [inline]
 

Get object holding path information.

PMError InstYou::setUserPassword const std::string &  username,
const std::string &  password,
bool  persistent
 

Write user name and password to configuration file.

Parameters:
username username
password password
persistent if true, write username/password to disk

PMError InstYou::showError const PMError error  ) 
 

Show error. Calls callbacks.

PMError InstYou::showError const std::string &  type,
const std::string &  text,
const std::string &  details
 

Show error. Calls callbacks.

PMError InstYou::showMessage const std::string &  type,
std::list< PMYouPatchPtr > & 
 

Show patch message.

void InstYou::showPatches bool  verbose = false  ) 
 

Print list of patches to stdout.

Parameters:
verbose show more detailed information.

FSize InstYou::totalDownloadSize  )  [inline]
 

Return total size of data to be downloaded based on current selection of patches.

void InstYou::updatePackageStates  ) 
 

Update states of packages according to states of patches.

std::string InstYou::username  )  const [inline]
 

PMError InstYou::verifyMediaNumber int  number,
int  lastNumber
[protected]
 

Verify that media with given number is present. If not the function asks the user to insert the correct one by using callbacks.

PMError InstYou::writeLastUpdate  )  [protected]
 

Writes current date as date of last update.


Member Data Documentation

InstYou::Callbacks * InstYou::_callbacks = 0 [static, private]
 

int InstYou::_currentMediaNumber [private]
 

PMYouPatchInfoPtr InstYou::_info [private]
 

int InstYou::_installedPatches [private]
 

MediaAccess InstYou::_media [private]
 

std::map<std::string,int> InstYou::_mediaMap [private]
 

std::string InstYou::_password [private]
 

std::vector<PMYouPatchPtr> InstYou::_patches [private]
 

int InstYou::_progressCurrent [private]
 

int InstYou::_progressTotal [private]
 

std::vector<PMYouPatchPtr>::const_iterator InstYou::_selectedPatchesIt [private]
 

PMYouSettingsPtr InstYou::_settings [private]
 

FSize InstYou::_totalDownloadSize [private]
 

std::string InstYou::_username [private]
 


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