- struct stat S;
- if (stat(IndexFile(LanguageCode().c_str()).c_str(),&S) != 0)
- return 0;
- return S.st_size;
-}
- /*}}}*/
-// TranslationsIndex::Merge - Load the index file into a cache /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const
-{
- // Check the translation file, if in use
- string TranslationFile = IndexFile(LanguageCode().c_str());
- if (TranslationsAvailable() && FileExists(TranslationFile))
- {
- FileFd Trans(TranslationFile,FileFd::ReadOnly);
- debListParser TransParser(&Trans);
- if (_error->PendingError() == true)
- return false;
-
- Prog.SubProgress(0, Info(TranslationFile.c_str()));
- if (Gen.SelectFile(TranslationFile,string(),*this) == false)
- return _error->Error("Problem with SelectFile %s",TranslationFile.c_str());
-
- // Store the IMS information
- pkgCache::PkgFileIterator TransFile = Gen.GetCurFile();
- struct stat TransSt;
- if (fstat(Trans.Fd(),&TransSt) != 0)
- return _error->Errno("fstat","Failed to stat");
- TransFile->Size = TransSt.st_size;
- TransFile->mtime = TransSt.st_mtime;
-
- if (Gen.MergeList(TransParser) == false)
- return _error->Error("Problem with MergeList %s",TranslationFile.c_str());
- }
-
- return true;