summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/cachefile.cc2
-rw-r--r--apt-private/private-search.cc6
2 files changed, 7 insertions, 1 deletions
diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc
index 0fd40106f..96bcdc097 100644
--- a/apt-pkg/cachefile.cc
+++ b/apt-pkg/cachefile.cc
@@ -140,6 +140,8 @@ bool pkgCacheFile::BuildPolicy(OpProgress * /*Progress*/)
/* */
bool pkgCacheFile::BuildDepCache(OpProgress *Progress)
{
+ if (BuildCaches(Progress, false) == false)
+ return false;
if (DCache != NULL)
return true;
diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc
index ecd5d7fad..e218bf76c 100644
--- a/apt-private/private-search.cc
+++ b/apt-private/private-search.cc
@@ -31,9 +31,13 @@ bool FullTextSearch(CommandLine &CmdL) /*{{{*/
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
+ if (unlikely(Cache == NULL))
+ return false;
+
pkgDepCache::Policy *Plcy = CacheFile.GetPolicy();
pkgRecords records(CacheFile);
- if (unlikely(Cache == NULL || Plcy == NULL))
+
+ if (unlikely(Plcy == NULL))
return false;
const char **patterns;