- /* Build all of the caches, using the cache files if we are locking
- (ie as root) */
- if (WithLock == true)
- {
- pkgMakeStatusCache(List,Progress);
- Progress.Done();
- if (_error->PendingError() == true)
- return _error->Error("The package lists or status file could not be parsed or opened.");
- if (_error->empty() == false)
- _error->Warning("You may want to run apt-get update to correct these missing files");
-
- // Open the cache file
- FileFd File(_config->FindFile("Dir::Cache::pkgcache"),FileFd::ReadOnly);
- if (_error->PendingError() == true)
- return false;
-
- Map = new MMap(File,MMap::Public | MMap::ReadOnly);
- if (_error->PendingError() == true)
- return false;
- }
- else
- {
- Map = pkgMakeStatusCacheMem(List,Progress);
- Progress.Done();
- if (Map == 0)
- return false;
- }
+ // The policy engine
+ Policy = new pkgPolicy(Cache);
+ if (_error->PendingError() == true)
+ return false;
+ if (ReadPinFile(*Policy) == false)
+ return false;