Browse Source

dpkg-triggers: deal properly with new package states; 0.7.6ubuntu6

tags/debian/0.7.24ubuntu1
Ian Jackson 14 years ago
parent
commit
fb7bf91ccc
7 changed files with 24 additions and 4 deletions
  1. +2
    -0
      apt-pkg/algorithms.cc
  2. +2
    -0
      apt-pkg/deb/deblistparser.cc
  3. +6
    -1
      apt-pkg/deb/dpkgpm.cc
  4. +4
    -2
      apt-pkg/pkgcache.cc
  5. +2
    -1
      apt-pkg/pkgcache.h
  6. +6
    -0
      debian/changelog
  7. +2
    -0
      doc/cache.sgml

+ 2
- 0
apt-pkg/algorithms.cc View File

@@ -257,6 +257,8 @@ bool pkgApplyStatus(pkgDepCache &Cache)
re-unpacked (probably) */
case pkgCache::State::UnPacked:
case pkgCache::State::HalfConfigured:
case pkgCache::State::TriggersAwaited:
case pkgCache::State::TriggersPending:
if ((I->CurrentVer != 0 && I.CurrentVer().Downloadable() == true) ||
I.State() != pkgCache::PkgIterator::NeedsUnpack)
Cache.MarkKeep(I, false, false);


+ 2
- 0
apt-pkg/deb/deblistparser.cc View File

@@ -293,6 +293,8 @@ bool debListParser::ParseStatus(pkgCache::PkgIterator Pkg,
{"installed",pkgCache::State::Installed},
{"half-installed",pkgCache::State::HalfInstalled},
{"config-files",pkgCache::State::ConfigFiles},
{"triggers-awaited",pkgCache::State::TriggersAwaited},
{"triggers-pending",pkgCache::State::TriggersPending},
{"post-inst-failed",pkgCache::State::HalfConfigured},
{"removal-failed",pkgCache::State::HalfInstalled},
{}};


+ 6
- 1
apt-pkg/deb/dpkgpm.cc View File

@@ -521,7 +521,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
// map the dpkg states to the operations that are performed
// (this is sorted in the same way as Item::Ops)
static const struct DpkgState DpkgStatesOpMap[][5] = {
static const struct DpkgState DpkgStatesOpMap[][7] = {
// Install operation
{
{"half-installed", N_("Preparing %s")},
@@ -532,12 +532,17 @@ bool pkgDPkgPM::Go(int OutStatusFd)
{
{"unpacked",N_("Preparing to configure %s") },
{"half-configured", N_("Configuring %s") },
{"triggers-awaited", N_("Processing triggers for %s") },
{"triggers-pending", N_("Processing triggers for %s") },
{"half-configured", N_("Configuring %s") },
{ "installed", N_("Installed %s")},
{NULL, NULL}
},
// Remove operation
{
{"half-configured", N_("Preparing for removal of %s")},
{"triggers-awaited", N_("Preparing for removal of %s")},
{"triggers-pending", N_("Preparing for removal of %s")},
{"half-installed", N_("Removing %s")},
{"config-files", N_("Removed %s")},
{NULL, NULL}


+ 4
- 2
apt-pkg/pkgcache.cc View File

@@ -49,7 +49,7 @@ pkgCache::Header::Header()
/* Whenever the structures change the major version should be bumped,
whenever the generator changes the minor version should be bumped. */
MajorVersion = 6;
MajorVersion = 7;
MinorVersion = 0;
Dirty = false;
@@ -274,7 +274,9 @@ pkgCache::PkgIterator::OkState pkgCache::PkgIterator::State() const
return NeedsUnpack;
if (Pkg->CurrentState == pkgCache::State::UnPacked ||
Pkg->CurrentState == pkgCache::State::HalfConfigured)
Pkg->CurrentState == pkgCache::State::HalfConfigured ||
Pkg->CurrentState == pkgCache::State::TriggersPending ||
Pkg->CurrentState == pkgCache::State::TriggersAwaited)
return NeedsConfigure;
if (Pkg->CurrentState == pkgCache::State::HalfInstalled ||


+ 2
- 1
apt-pkg/pkgcache.h View File

@@ -81,7 +81,8 @@ class pkgCache
enum PkgSelectedState {Unknown=0,Install=1,Hold=2,DeInstall=3,Purge=4};
enum PkgInstState {Ok=0,ReInstReq=1,HoldInst=2,HoldReInstReq=3};
enum PkgCurrentState {NotInstalled=0,UnPacked=1,HalfConfigured=2,
HalfInstalled=4,ConfigFiles=5,Installed=6};
HalfInstalled=4,ConfigFiles=5,Installed=6,
TriggersAwaited=7,TriggersPending=8};
};
struct Flag


+ 6
- 0
debian/changelog View File

@@ -1,3 +1,9 @@
apt (0.7.6ubuntu6) gutsy; urgency=low

* dpkg-triggers: Deal properly with new package states.

-- Ian Jackson <iwj@ubuntu.com> Wed, 15 Aug 2007 20:44:37 +0100

apt (0.7.6ubuntu5) UNRELEASED; urgency=low

* apt-pkg/acquire-item.cc:


+ 2
- 0
doc/cache.sgml View File

@@ -721,6 +721,8 @@ or'd with the current package.
#define pkgSTATE_HalfInstalled 4
#define pkgSTATE_ConfigFiles 5
#define pkgSTATE_Installed 6
#define pkgSTATE_TriggersAwaited 7
#define pkgSTATE_TriggersPending 8
</example>
</sect1>



Loading…
Cancel
Save