]> git.saurik.com Git - apt.git/commitdiff
Only show packages as upgradable if the have a CandidateVer != 0
authorMichael Vogt <mvo@ubuntu.com>
Tue, 8 Jul 2014 14:06:56 +0000 (16:06 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Tue, 8 Jul 2014 14:06:56 +0000 (16:06 +0200)
Closes: #753297
apt-private/private-output.cc
apt-private/private-update.cc

index 158bd5c71a37fa22eb118d7d96f4395e94250771..7f8922138fac2b81102af1659102a973d5cdd91d 100644 (file)
@@ -118,7 +118,7 @@ static std::string GetFlagsStr(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)
    std::string flags_str;
    if (state.NowBroken())
       flags_str = "B";
-   if (P.CurrentVer() && state.Upgradable())
+   if (P.CurrentVer() && state.Upgradable() && state.CandidateVer != NULL)
       flags_str = "g";
    else if (P.CurrentVer() != NULL)
       flags_str = "i";
@@ -229,7 +229,8 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records,        /*{{{*/
       std::string CandidateVerStr = GetCandidateVersion(CacheFile, P);
       std::string InstalledVerStr = GetInstalledVersion(CacheFile, P);
       std::string StatusStr;
-      if(P.CurrentVer() == V && state.Upgradable()) {
+      if(P.CurrentVer() == V && state.Upgradable() && state.CandidateVer != NULL)
+      {
          strprintf(StatusStr, _("[installed,upgradable to: %s]"),
                    CandidateVerStr.c_str());
       } else if (P.CurrentVer() == V) {
index 0f2f7a8daf036beb711148f2a6b58782f4f30bf6..860d84b86ddfa7dc3af7225c86133c291323a7b0 100644 (file)
@@ -83,7 +83,7 @@ bool DoUpdate(CommandLine &CmdL)
       for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() != true; ++I)
       {
          pkgDepCache::StateCache &state = Cache[I];
-         if (I->CurrentVer != 0 && state.Upgradable())
+         if (I->CurrentVer != 0 && state.Upgradable() && state.CandidateVer != NULL)
             upgradable++;
       }
       const char *msg = P_(