From 6009e60d0192832277242438ad7ca2fc24a4c075 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 15 Jul 2009 23:57:07 +0200 Subject: display warnings instead of errors if the parts dirs doesn't exist Parts dirs are /etc/apt/{sources.list,apt.conf,preferences}.d (in the default setup) --- apt-pkg/cachefile.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg/cachefile.cc') diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index 0b1efb9ff..790312dc8 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -48,6 +48,7 @@ pkgCacheFile::~pkgCacheFile() /* */ bool pkgCacheFile::BuildCaches(OpProgress &Progress,bool WithLock) { + const bool ErrorWasEmpty = _error->empty(); if (WithLock == true) if (_system->Lock() == false) return false; @@ -70,7 +71,7 @@ bool pkgCacheFile::BuildCaches(OpProgress &Progress,bool WithLock) return _error->Error(_("The package lists or status file could not be parsed or opened.")); /* This sux, remove it someday */ - if (_error->empty() == false) + if (ErrorWasEmpty == true && _error->empty() == false) _error->Warning(_("You may want to run apt-get update to correct these problems")); Cache = new pkgCache(Map); @@ -91,6 +92,7 @@ bool pkgCacheFile::Open(OpProgress &Progress,bool WithLock) Policy = new pkgPolicy(Cache); if (_error->PendingError() == true) return false; + if (ReadPinFile(*Policy) == false || ReadPinDir(*Policy) == false) return false; -- cgit v1.2.3