From c8e572e3cf36209f3693ce83c47ebce02be9fb99 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 9 Jan 2010 21:19:03 +0100 Subject: * apt-pkg/deb/debindexfile.cc, apt-pkg/pkgcachegen.cc: - add debug option Debug::pkgCacheGen - merge fix for apt-get source pkg=version regression (closes: #561971) --- apt-pkg/deb/debindexfile.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'apt-pkg/deb/debindexfile.cc') diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index ed7633803..be8175e31 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -306,9 +306,19 @@ pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const struct stat St; if (stat(File.FileName(),&St) != 0) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "PackagesIndex::FindInCache - stat failed on " << File.FileName() << std::endl; return pkgCache::PkgFileIterator(Cache); + } if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "PackagesIndex::FindInCache - size (" << St.st_size << " <> " << File->Size + << ") or mtime (" << St.st_mtime << " <> " << File->mtime + << ") doesn't match for " << File.FileName() << std::endl; return pkgCache::PkgFileIterator(Cache); + } return File; } @@ -472,9 +482,19 @@ pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) con struct stat St; if (stat(File.FileName(),&St) != 0) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "TranslationIndex::FindInCache - stat failed on " << File.FileName() << std::endl; return pkgCache::PkgFileIterator(Cache); + } if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "TranslationIndex::FindInCache - size (" << St.st_size << " <> " << File->Size + << ") or mtime (" << St.st_mtime << " <> " << File->mtime + << ") doesn't match for " << File.FileName() << std::endl; return pkgCache::PkgFileIterator(Cache); + } return File; } return File; @@ -541,9 +561,19 @@ pkgCache::PkgFileIterator debStatusIndex::FindInCache(pkgCache &Cache) const struct stat St; if (stat(File.FileName(),&St) != 0) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "StatusIndex::FindInCache - stat failed on " << File.FileName() << std::endl; return pkgCache::PkgFileIterator(Cache); + } if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "StatusIndex::FindInCache - size (" << St.st_size << " <> " << File->Size + << ") or mtime (" << St.st_mtime << " <> " << File->mtime + << ") doesn't match for " << File.FileName() << std::endl; return pkgCache::PkgFileIterator(Cache); + } return File; } return File; -- cgit v1.2.3