X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/3addaba1ff6fe27cc96af5c2d345ee039c2bffec..baec76f5f0f9fcbd71f6e2afaa7fc85543bd624c:/apt-private/private-cacheset.cc diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc index 439b844d5..52cd22d2a 100644 --- a/apt-private/private-cacheset.cc +++ b/apt-private/private-cacheset.cc @@ -30,13 +30,18 @@ bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile, Matcher &matcher, OpProgress * const progress) { - pkgCache *Cache = CacheFile.GetPkgCache(); - pkgDepCache *DepCache = CacheFile.GetDepCache(); + pkgCache * const Cache = CacheFile.GetPkgCache(); + if (unlikely(Cache == nullptr)) + return false; + if (progress != nullptr) + progress->SubProgress(Cache->Head().PackageCount, _("Sorting")); + + pkgDepCache * const DepCache = CacheFile.GetDepCache(); + if (unlikely(DepCache == nullptr)) + return false; APT::CacheSetHelper helper(false); int Done=0; - if (progress != NULL) - progress->SubProgress(Cache->Head().PackageCount, _("Sorting")); bool const insertCurrentVer = _config->FindB("APT::Cmd::Installed", false); bool const insertUpgradable = _config->FindB("APT::Cmd::Upgradable", false); @@ -179,8 +184,8 @@ CacheSetHelperVirtuals::CacheSetHelperVirtuals(bool const ShowErrors, GlobalErro /*}}}*/ // CacheSetHelperAPTGet - responsible for message telling from the CacheSets/*{{{*/ -CacheSetHelperAPTGet::CacheSetHelperAPTGet(std::ostream &out) : - APT::CacheSetHelper{true}, out(out) +CacheSetHelperAPTGet::CacheSetHelperAPTGet(std::ostream &pout) : + APT::CacheSetHelper{true}, out(pout) { explicitlyNamed = true; } @@ -245,8 +250,6 @@ bool CacheSetHelperAPTGet::showVirtualPackageErrors(pkgCacheFile &Cache) "This may mean that the package is missing, has been obsoleted, or\n" "is only available from another source\n"),Pkg.FullName(true).c_str()); - std::string List; - std::string VersionsList; std::vector Seen(Cache.GetPkgCache()->Head().PackageCount, false); APT::PackageList pkglist; for (pkgCache::DepIterator Dep = Pkg.RevDependsList();