El Te Dee Patch
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:56:03 +0000 (16:56 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:56:03 +0000 (16:56 +0000)
Author: jgg
Date: 2000-05-31 02:49:37 GMT
El Te Dee Patch

apt-pkg/depcache.cc
apt-pkg/depcache.h
apt-pkg/makefile

index 707cb93..1469126 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: depcache.cc,v 1.21 1999/10/22 05:58:54 jgg Exp $
+// $Id: depcache.cc,v 1.22 2000/05/31 02:49:37 jgg Exp $
 /* ######################################################################
 
    Dependency Cache - Caches Dependency information.
@@ -275,7 +275,7 @@ void pkgDepCache::AddStates(const PkgIterator &Pkg,int Add)
    }
    
    // Installed, no upgrade
-   if (State.Upgradable() == false)
+   if (State.Status == 0)
    {    
       if (State.Mode == ModeDelete)
         iDelCount += Add;
@@ -770,3 +770,21 @@ const char *pkgDepCache::StateCache::StripEpoch(const char *Ver)
    return Ver;
 }
                                                                        /*}}}*/
+// StateCache::SetCandidateVersion - Change the candidate version      /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+void pkgDepCache::SetCandidateVersion(VerIterator TargetVer)
+{
+   pkgCache::PkgIterator I = TargetVer.ParentPkg();
+   
+   RemoveSizes(I);
+   RemoveStates(I);
+   
+   PkgState[I->ID].CandidateVer = (Version *) TargetVer;
+   PkgState[I->ID].Update(I, *this);
+   
+   AddStates(I);
+   Update(I);
+   AddSizes(I);
+}
+                                                                       /*}}}*/
index 6ce204e..3bb677d 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: depcache.h,v 1.12 1999/10/22 05:58:54 jgg Exp $
+// $Id: depcache.h,v 1.13 2000/05/31 02:49:37 jgg Exp $
 /* ######################################################################
 
    DepCache - Dependency Extension data for the cache
@@ -95,7 +95,7 @@ class pkgDepCache : public pkgCache
       inline bool Keep() const {return Mode == ModeKeep;};
       inline bool Upgrade() const {return Status > 0 && Mode == ModeInstall;};
       inline bool Upgradable() const {return Status >= 1;};
-      inline bool Downgrade() const {return Status < 0;};
+      inline bool Downgrade() const {return Status < 0 && Mode == ModeInstall;};
       inline bool Held() const {return Status != 0 && Keep();};
       inline bool NowBroken() const {return (DepState & DepNowMin) != DepNowMin;};
       inline bool InstBroken() const {return (DepState & DepInstMin) != DepInstMin;};
@@ -165,6 +165,7 @@ class pkgDepCache : public pkgCache
    void MarkDelete(PkgIterator const &Pkg,bool Purge = false);
    void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true);
    void SetReInstall(PkgIterator const &Pkg,bool To);
+   void SetCandidateVersion(VerIterator TargetVer);
    
    // This is for debuging
    void Update(OpProgress *Prog = 0);
index b4d2531..d5e2037 100644 (file)
@@ -12,7 +12,7 @@ include ../buildlib/defaults.mak
 # The library name
 LIBRARY=apt-pkg
 MAJOR=2.7
-MINOR=1
+MINOR=2
 SLIBS=$(PTHREADLIB)
 
 # Source code for the contributed non-core things