-
- // Status files that must be in the cache
- string Status[3];
- Status[0] = _config->FindFile("Dir::State::xstatus");
- Status[1]= _config->FindFile("Dir::State::userstatus");
- Status[2] = _config->FindFile("Dir::State::status");
-
- // Cheack each file
- for (pkgCache::PkgFileIterator F(Cache); F.end() == false; F++)
- {
- if (F.IsOk() == false)
- return false;
-
- // See if this is one of the status files
- for (int I = 0; I != 3; I++)
- if (F.FileName() == Status[I])
- Status[I] = string();
- }
-
- // Make sure all the status files are loaded.
- for (int I = 0; I != 3; I++)
- {
- if (Status[I].empty() == false && FileExists(Status[I]) == true)
- return false;
- }
-
- return true;
-}
- /*}}}*/
-// AddSourcesSize - Add the size of the status files /*{{{*/
-// ---------------------------------------------------------------------
-/* This adds the size of all the status files to the size counter */
-static bool pkgAddSourcesSize(unsigned long &TotalSize)
-{
- // Grab the file names
- string xstatus = _config->FindFile("Dir::State::xstatus");
- string userstatus = _config->FindFile("Dir::State::userstatus");
- string status = _config->FindFile("Dir::State::status");
-
- // Grab the sizes
- struct stat Buf;
- if (stat(xstatus.c_str(),&Buf) == 0)
- TotalSize += Buf.st_size;
- if (stat(userstatus.c_str(),&Buf) == 0)
- TotalSize += Buf.st_size;
- if (stat(status.c_str(),&Buf) != 0)
- return _error->Errno("stat","Couldn't stat the status file %s",status.c_str());
- TotalSize += Buf.st_size;