From f416d22e97c56eedc8b4303a5aecfffaaa23eb1c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 13 May 2005 14:40:29 +0000 Subject: [PATCH] * fixed a problem when it comes to the cache rebuilding --- apt-pkg/deb/debindexfile.cc | 25 +++++++++++++------------ apt-pkg/deb/debindexfile.h | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index b8435a6bc..67fddfbd4 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -458,20 +458,21 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const /* */ pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) const { + string FileName = TranslationFile(); + pkgCache::PkgFileIterator File = Cache.FileBegin(); - if (this->UseTranslation()) - for (; File.end() == false; File++) - { - if (IndexFile(LanguageCode().c_str()) != File.FileName()) - continue; + for (; File.end() == false; File++) + { + if (FileName != File.FileName()) + continue; - struct stat St; - if (stat(File.FileName(),&St) != 0) - return pkgCache::PkgFileIterator(Cache); - if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime) - return pkgCache::PkgFileIterator(Cache); - return File; - } + struct stat St; + if (stat(File.FileName(),&St) != 0) + return pkgCache::PkgFileIterator(Cache); + if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime) + return pkgCache::PkgFileIterator(Cache); + return File; + } return File; } /*}}}*/ diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 6d423318e..02c776882 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -96,7 +96,7 @@ class debTranslationsIndex : public pkgIndexFile // Interface for the Cache Generator virtual bool Exists() const; - virtual bool HasPackages() const {return true;}; + virtual bool HasPackages() const { return UseTranslation();}; virtual unsigned long Size() const; virtual bool Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const; virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; -- 2.45.2