]> git.saurik.com Git - apt.git/commitdiff
Only make Upgradable() return true for packages with a candidate
authorJulian Andres Klode <jak@debian.org>
Wed, 12 Aug 2015 11:10:32 +0000 (13:10 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 12 Aug 2015 11:10:32 +0000 (13:10 +0200)
If there is no candidate, the package should not be considered
upgradeable.

LP: #896689

apt-pkg/depcache.h

index aa281f695c0de1699bbdf1b2f3050ceab9f513f4..6a1d6f8b37e17b796093282b979da54bdc341721 100644 (file)
@@ -250,7 +250,7 @@ class pkgDepCache : protected pkgCache::Namespace
       inline bool Keep() const {return Mode == ModeKeep;};
       inline bool Protect() const {return (iFlags & Protected) == Protected;};
       inline bool Upgrade() const {return Status > 0 && Mode == ModeInstall;};
       inline bool Keep() const {return Mode == ModeKeep;};
       inline bool Protect() const {return (iFlags & Protected) == Protected;};
       inline bool Upgrade() const {return Status > 0 && Mode == ModeInstall;};
-      inline bool Upgradable() const {return Status >= 1;};
+      inline bool Upgradable() const {return Status >= 1 && CandidateVer != NULL;};
       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 Downgrade() const {return Status < 0 && Mode == ModeInstall;};
       inline bool Held() const {return Status != 0 && Keep();};
       inline bool NowBroken() const {return (DepState & DepNowMin) != DepNowMin;};