apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pkgDPkgPM Class Reference

#include <dpkgpm.h>

Inheritance diagram for pkgDPkgPM:
[legend]
Collaboration diagram for pkgDPkgPM:
[legend]

Classes

struct  DpkgState
 
struct  Item
 

Public Member Functions

 pkgDPkgPM (pkgDepCache *Cache)
 
virtual ~pkgDPkgPM ()
 
- Public Member Functions inherited from pkgPackageManager
bool GetArchives (pkgAcquire *Owner, pkgSourceList *Sources, pkgRecords *Recs)
 
OrderResult DoInstall (APT::Progress::PackageManager *progress)
 
OrderResult DoInstallPreFork ()
 
OrderResult DoInstallPostFork (APT::Progress::PackageManager *progress)
 
bool FixMissing ()
 
std::set< std::string > GetDisappearedPackages ()
 returns all packages dpkg let disappear More...
 
 pkgPackageManager (pkgDepCache *Cache)
 
virtual ~pkgPackageManager ()
 

Static Public Member Functions

static APT_HIDDEN bool ExpandPendingCalls (std::vector< Item > &List, pkgDepCache &Cache)
 

Protected Member Functions

bool RunScriptsWithPkgs (const char *Cnf)
 
bool SendPkgsInfo (FILE *const F, unsigned int const &Version)
 
void WriteHistoryTag (std::string const &tag, std::string value)
 
std::string ExpandShortPackageName (pkgDepCache &Cache, const std::string &short_pkgname)
 
void SendTerminalProgress (float percentage)
 
void WriteApportReport (const char *pkgpath, const char *errormsg)
 
bool OpenLog ()
 
bool CloseLog ()
 
void BuildPackagesProgressMap ()
 
void StartPtyMagic ()
 
void SetupSlavePtyMagic ()
 
void StopPtyMagic ()
 
void DoStdin (int master)
 
void DoTerminalPty (int master)
 
void DoDpkgStatusFd (int statusfd)
 
void ProcessDpkgStatusLine (char *line)
 
virtual bool Install (PkgIterator Pkg, std::string File) APT_OVERRIDE
 
virtual bool Configure (PkgIterator Pkg) APT_OVERRIDE
 
virtual bool Remove (PkgIterator Pkg, bool Purge=false) APT_OVERRIDE
 
virtual bool Go (APT::Progress::PackageManager *progress) APT_OVERRIDE
 
virtual void Reset () APT_OVERRIDE
 
- Protected Member Functions inherited from pkgPackageManager
void ImmediateAdd (PkgIterator P, bool UseInstallVer, unsigned const int &Depth=0)
 
virtual OrderResult OrderInstall ()
 
bool CheckRConflicts (PkgIterator Pkg, DepIterator Dep, const char *Ver)
 
bool CheckRBreaks (PkgIterator const &Pkg, DepIterator Dep, const char *const Ver)
 
bool CreateOrderList ()
 
bool DepAlwaysTrue (DepIterator D) APT_PURE
 
bool ConfigureAll ()
 
bool SmartConfigure (PkgIterator Pkg, int const Depth) APT_MUSTCHECK
 
bool SmartUnPack (PkgIterator Pkg, bool const Immediate=true, int const Depth=0) APT_MUSTCHECK
 
bool SmartRemove (PkgIterator Pkg) APT_MUSTCHECK
 
bool EarlyRemove (PkgIterator Pkg, DepIterator const *const Dep) APT_MUSTCHECK
 

Protected Attributes

int pkgFailures
 
std::map< std::string, std::vector< struct DpkgState > > PackageOps
 
std::map< std::string, unsigned int > PackageOpsDone
 
unsigned int PackagesDone
 
unsigned int PackagesTotal
 
std::vector< ItemList
 
- Protected Attributes inherited from pkgPackageManager
std::string * FileNames
 
pkgDepCacheCache
 
pkgOrderListList
 
bool Debug
 
bool NoImmConfigure
 
bool ImmConfigureAll
 
std::set< std::string > disappearedPkgs
 saves packages dpkg let disappear More...
 
OrderResult Res
 

Private Member Functions

APT_HIDDEN void handleDisappearAction (std::string const &pkgname)
 record the disappear action and handle accordingly More...
 
APT_HIDDEN void handleCrossUpgradeAction (std::string const &pkgname)
 

Private Attributes

pkgDPkgPMPrivate *const d
 

Additional Inherited Members

- Public Types inherited from pkgPackageManager
enum  OrderResult { Completed , Failed , Incomplete }
 
- Static Public Attributes inherited from pkgPackageManager
static bool SigINTStop = false
 
- Protected Types inherited from pkgCache< Str, Itr >::Namespace
typedef pkgCache::GrpIterator GrpIterator
 
typedef pkgCache::PkgIterator PkgIterator
 
typedef pkgCache::VerIterator VerIterator
 
typedef pkgCache::DescIterator DescIterator
 
typedef pkgCache::DepIterator DepIterator
 
typedef pkgCache::PrvIterator PrvIterator
 
typedef pkgCache::RlsFileIterator RlsFileIterator
 
typedef pkgCache::PkgFileIterator PkgFileIterator
 
typedef pkgCache::VerFileIterator VerFileIterator
 
typedef pkgCache::Version Version
 
typedef pkgCache::Description Description
 
typedef pkgCache::Package Package
 
typedef pkgCache::Header Header
 
typedef pkgCache::Dep Dep
 
typedef pkgCache::Flag Flag
 

Detailed Description

Definition at line 29 of file dpkgpm.h.

Constructor & Destructor Documentation

◆ pkgDPkgPM()

pkgDPkgPM ( pkgDepCache Cache)
explicit

Definition at line 230 of file dpkgpm.cc.

◆ ~pkgDPkgPM()

~pkgDPkgPM ( )
virtual

Definition at line 238 of file dpkgpm.cc.

References d.

Member Function Documentation

◆ BuildPackagesProgressMap()

void BuildPackagesProgressMap ( )
protected

◆ CloseLog()

◆ Configure()

bool Configure ( PkgIterator  Pkg)
protectedvirtual

Reimplemented from pkgPackageManager.

Definition at line 270 of file dpkgpm.cc.

References _config, pkgDPkgPM::Item::Configure, List, and pkgDPkgPM::Item::TriggersPending.

◆ DoDpkgStatusFd()

void DoDpkgStatusFd ( int  statusfd)
protected

◆ DoStdin()

void DoStdin ( int  master)
protected

Definition at line 541 of file dpkgpm.cc.

References d, pkgDPkgPMPrivate::stdin_is_dev_null, and FileFd::Write().

Referenced by Go().

◆ DoTerminalPty()

void DoTerminalPty ( int  master)
protected

Definition at line 556 of file dpkgpm.cc.

References d, pkgDPkgPMPrivate::term_out, and FileFd::Write().

Referenced by Go().

◆ ExpandPendingCalls()

bool ExpandPendingCalls ( std::vector< Item > &  List,
pkgDepCache Cache 
)
static

◆ ExpandShortPackageName()

std::string ExpandShortPackageName ( pkgDepCache Cache,
const std::string &  short_pkgname 
)
protected

◆ Go()

bool Go ( APT::Progress::PackageManager progress)
protectedvirtual

Reimplemented from pkgPackageManager.

Definition at line 1458 of file dpkgpm.cc.

References _config, _system, ADDARG, ADDARGC, debSystem::AssertFeature(), CacheFile::BuildCaches(), BuildPackagesProgressMap(), pkgPackageManager::Cache, cleanUpTmpDir(), StateChanges::clear(), CloseLog(), pkgDPkgPM::Item::Configure, pkgDPkgPM::Item::ConfigurePending, d, pkgCache< Str, Itr >::State::DeInstall, pkgDPkgPMPrivate::direct_stdin, pkgPackageManager::disappearedPkgs, DoDpkgStatusFd(), DoStdin(), DoTerminalPty(), pkgDPkgPMPrivate::dpkg_error, debSystem::DpkgChrootDirectory(), StateChanges::empty(), VersionContainer< Container >::empty(), EnvironmentSize(), VersionContainer< Container >::erase(), ExecFork(), ExpandPendingCalls(), pkgDepCache::FindPkg(), FindToBeRemovedVersion(), flExtension(), flNotDir(), debSystem::GetDpkgBaseCommand(), PackageManager::GetPulseInterval(), GetTempDir(), pkgDepCache::Head(), I, pkgCache< Str, Itr >::Package::ID, Inhibit(), pkgDPkgPM::Item::Install, StateChanges::Install(), ionice(), pkgSystem::IsLocked(), ItemIsEssential(), ItemIsProtected(), List, pkgDPkgPMPrivate::master, MergeKeepFdsFromConfiguration(), pkgSystem::MultiArchSupported(), OpenLog(), pkgDPkgPMPrivate::original_sigmask, pkgCache< Str, Itr >::Header::PackageCount, PackageOps, PackageOpsDone, PackagesDone, PackagesTotal, pkgDPkgPM::Item::Pkg, pkgDepCache::PkgBegin(), pkgCache< Str, Itr >::PkgIterator(), pkgDPkgPMPrivate::progress, PackageManager::Pulse(), pkgDPkgPM::Item::Purge, pkgCache< Str, Itr >::State::Purge, StateChanges::Purge(), pkgDPkgPM::Item::PurgePending, RealFileExists(), pkgDPkgPM::Item::Remove, StateChanges::Remove(), RemoveFile(), pkgDPkgPM::Item::RemovePending, RunScripts(), RunScriptsWithPkgs(), pkgCache< Str, Itr >::Version::Same, StateChanges::Save(), SetupSlavePtyMagic(), SigINT(), pkgPackageManager::SigINTStop, pkgDPkgPMPrivate::sigmask, PackageManager::Start(), PackageManager::StartDpkg(), StartPtyMagic(), Status, pkgDPkgPMPrivate::status_fd_reached_end_of_file, pkgDPkgPMPrivate::stdin_is_dev_null, PackageManager::Stop(), StopPtyMagic(), strprintf(), pkgDPkgPM::Item::TriggersPending, pkgCache< Str, Itr >::VerIterator(), pkgDepCache::VS(), and pkgDepCache::writeStateFile().

◆ handleCrossUpgradeAction()

void handleCrossUpgradeAction ( std::string const &  pkgname)
private

◆ handleDisappearAction()

void handleDisappearAction ( std::string const &  pkgname)
private

record the disappear action and handle accordingly

dpkg let packages disappear then they have no files any longer and nothing depends on them. We need to collect this as dpkg as well as APT doesn't know beforehand that the package will disappear, so the only possible option is to tell the user afterwards about it. To enhance the experience we also try to forward the auto-install flag so the disappear-causer(s) are not autoremoved next time - for the transfer to happen the disappeared version needs to depend on the package the flag should be forwarded to and this package needs to declare a Replaces on the disappeared package.

Parameters
pkgnameName of the package that disappeared

Definition at line 873 of file dpkgpm.cc.

References pkgCache< Str, Itr >::Flag::Auto, pkgPackageManager::Cache, pkgPackageManager::Debug, pkgCache< Str, Itr >::Dep::Depends, pkgCache< Str, Itr >::DepIterator(), pkgPackageManager::disappearedPkgs, pkgDepCache::FindPkg(), PackageOps, PackageOpsDone, PackagesDone, pkgCache< Str, Itr >::PkgIterator(), pkgCache< Str, Itr >::Dep::PreDepends, pkgCache< Str, Itr >::Dep::Replaces, and pkgCache< Str, Itr >::VerIterator().

Referenced by ProcessDpkgStatusLine().

◆ Install()

bool Install ( PkgIterator  Pkg,
std::string  File 
)
protectedvirtual

Reimplemented from pkgPackageManager.

Definition at line 246 of file dpkgpm.cc.

References _config, pkgDPkgPM::Item::Install, and List.

Referenced by handleCrossUpgradeAction(), and ProcessDpkgStatusLine().

◆ OpenLog()

◆ ProcessDpkgStatusLine()

◆ Remove()

bool Remove ( PkgIterator  Pkg,
bool  Purge = false 
)
protectedvirtual

Reimplemented from pkgPackageManager.

Definition at line 288 of file dpkgpm.cc.

References List, pkgDPkgPM::Item::Purge, and pkgDPkgPM::Item::Remove.

◆ Reset()

void Reset ( )
protectedvirtual

Reimplemented from pkgPackageManager.

Definition at line 2234 of file dpkgpm.cc.

References List.

◆ RunScriptsWithPkgs()

◆ SendPkgsInfo()

◆ SendTerminalProgress()

void SendTerminalProgress ( float  percentage)
protected

◆ SetupSlavePtyMagic()

void SetupSlavePtyMagic ( )
protected

◆ StartPtyMagic()

◆ StopPtyMagic()

void StopPtyMagic ( )
protected

◆ WriteApportReport()

◆ WriteHistoryTag()

void WriteHistoryTag ( std::string const &  tag,
std::string  value 
)
protected

Definition at line 997 of file dpkgpm.cc.

References d, and pkgDPkgPMPrivate::history_out.

Referenced by CloseLog(), and OpenLog().

Member Data Documentation

◆ d

◆ List

◆ PackageOps

std::map<std::string,std::vector<struct DpkgState> > PackageOps
protected

◆ PackageOpsDone

std::map<std::string,unsigned int> PackageOpsDone
protected

◆ PackagesDone

unsigned int PackagesDone
protected

◆ PackagesTotal

unsigned int PackagesTotal
protected

Definition at line 71 of file dpkgpm.h.

Referenced by BuildPackagesProgressMap(), Go(), and ProcessDpkgStatusLine().

◆ pkgFailures

int pkgFailures
protected

Definition at line 51 of file dpkgpm.h.

Referenced by ProcessDpkgStatusLine(), and WriteApportReport().


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