]> git.saurik.com Git - apt.git/commitdiff
* dpkg-triggers: Deal properly with new package states.
authorMichael Vogt <egon@bottom>
Mon, 10 Sep 2007 13:59:55 +0000 (15:59 +0200)
committerMichael Vogt <egon@bottom>
Mon, 10 Sep 2007 13:59:55 +0000 (15:59 +0200)
apt-pkg/algorithms.cc
apt-pkg/deb/deblistparser.cc
apt-pkg/deb/dpkgpm.cc
apt-pkg/pkgcache.cc
apt-pkg/pkgcache.h
debian/changelog
doc/cache.sgml

index b21fcbb2f9b4e9a8d51553b5877bd3b45cc90054..62727a852fd01504e7cd27820913b153449f6231 100644 (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);
index 074abea6d0ae76f5ccc4ff37ae0ede852cad91ba..896d4d6d8590c3ef697d3171ea5f0bf994593e5c 100644 (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},
                             {}};
index bb7e4b40a8c62f7c35aa664d6d8cfe8acf6e3930..36086d72e06553bba81d1a145a9c3f3c56fdcb9a 100644 (file)
@@ -518,7 +518,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")}, 
@@ -529,12 +529,20 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       { 
         {"unpacked",N_("Preparing to configure %s") },
         {"half-configured", N_("Configuring %s") },
+#if 0
+        {"triggers-awaited", N_("Processing triggers for %s") },
+        {"triggers-pending", N_("Processing triggers for %s") },
+#endif
         { "installed", N_("Installed %s")},
         {NULL, NULL}
       },
       // Remove operation
       { 
         {"half-configured", N_("Preparing for removal of %s")},
+#if 0
+        {"triggers-awaited", N_("Preparing for removal of %s")},
+        {"triggers-pending", N_("Preparing for removal of %s")},
+#endif
         {"half-installed", N_("Removing %s")},
         {"config-files",  N_("Removed %s")},
         {NULL, NULL}
index 7e3b9d78c9a5a58ebbb8913d69a5b421dc5f821f..133899a274fa8728f0a43181ea90426eab92ebda 100644 (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 ||
index 83b7548a3da01e7ab5b52492f882e31fd387a826..59d5003bba4f7ecc0f151b1c8e82ba94639d13eb 100644 (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
index eadd38eaca5f318e48dc8b0f9630417e09412a09..d6686ecda02f779be8f44b63a976aa4be1c821ff 100644 (file)
@@ -39,6 +39,9 @@ apt (0.7.7) UNRELEASED; urgency=low
   * Reset curl options and timestamp between downloaded files. Thanks to
     Ryan Murray <rmurray@debian.org> for the patch (closes: #437150)
 
+  [ Ian Jackson ]
+  * dpkg-triggers: Deal properly with new package states.
+
  -- Otavio Salvador <otavio@debian.org>  Mon, 06 Aug 2007 10:44:53 -0300
 
 apt (0.7.6) unstable; urgency=low
index e257dcd819fd6f5e48c2419caca0280fc7ff03f7..aea5a45c35c580199117872310044143e0fe5c89 100644 (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>