diff options
Diffstat (limited to 'apt-pkg/cachefile.cc')
-rw-r--r-- | apt-pkg/cachefile.cc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index 964c5bd8b..a253f17f6 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -50,23 +50,23 @@ pkgCacheFile::~pkgCacheFile() /* */ bool pkgCacheFile::BuildCaches(OpProgress *Progress, bool WithLock) { - if (Cache != NULL) - return true; - - if (_config->FindB("pkgCacheFile::Generate", true) == false) - { - Map = new MMap(*new FileFd(_config->FindFile("Dir::Cache::pkgcache"), - FileFd::ReadOnly),MMap::Public|MMap::ReadOnly); - Cache = new pkgCache(Map); - if (_error->PendingError() == true) - return false; - return true; - } - - const bool ErrorWasEmpty = _error->empty(); - if (WithLock == true) - if (_system->Lock() == false) - return false; + if (Cache != NULL) + return true; + + if (_config->FindB("pkgCacheFile::Generate", true) == false) + { + Map = new MMap(*new FileFd(_config->FindFile("Dir::Cache::pkgcache"), + FileFd::ReadOnly),MMap::Public|MMap::ReadOnly); + Cache = new pkgCache(Map); + if (_error->PendingError() == true) + return false; + return true; + } + + const bool ErrorWasEmpty = _error->empty(); + if (WithLock == true) + if (_system->Lock() == false) + return false; if (_config->FindB("Debug::NoLocking",false) == true) WithLock = false; |