X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/0fae1ac4bfbf62e556f1d6a316b0a576c62d4131..4aa8cc9127bdf5837b51b49d917c4ac229b2c540:/apt-pkg/policy.cc diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index eb90daca7..ff59fb0ac 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -307,16 +307,21 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &Fi bool ReadPinDir(pkgPolicy &Plcy,string Dir) { if (Dir.empty() == true) - Dir = _config->FindDir("Dir::Etc::PreferencesParts"); + Dir = _config->FindDir("Dir::Etc::PreferencesParts", "/dev/null"); if (DirectoryExists(Dir) == false) { - if (Dir != "/dev/null") + if (APT::String::Endswith(Dir, "/dev/null") == false) _error->WarningE("DirectoryExists",_("Unable to read %s"),Dir.c_str()); return true; } + _error->PushToStack(); vector const List = GetListOfFilesInDir(Dir, "pref", true, true); + bool const PendingErrors = _error->PendingError(); + _error->MergeWithStack(); + if (PendingErrors) + return false; // Read the files for (vector::const_iterator I = List.begin(); I != List.end(); ++I)