diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:50:58 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:50:58 +0000 |
commit | c5162d564ac98a1e97812ec5d290d2375c0820d8 (patch) | |
tree | 547a70fd355e85f1fa5d74a1b015e612f905e160 /apt-pkg/pkgcachegen.cc | |
parent | 6f27a7fc6c8471534c5cee39cffdc2def1388bdc (diff) |
Sync
Author: jgg
Date: 1998-09-18 02:42:38 GMT
Sync
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 825af40c0..46ae33c83 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgcachegen.cc,v 1.15 1998/09/07 05:28:37 jgg Exp $ +// $Id: pkgcachegen.cc,v 1.16 1998/09/18 02:42:38 jgg Exp $ /* ###################################################################### Package Cache Generator - Generator for the cache structure. @@ -409,9 +409,23 @@ bool pkgSrcCacheCheck(pkgSourceList &List) _error->Discard(); return false; } - + + // Count the number of missing files + int Missing = 0; + for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); I++) + { + string File = ListDir + URItoFileName(I->PackagesURI()); + struct stat Buf; + if (stat(File.c_str(),&Buf) != 0) + { + _error->WarningE("stat","Couldn't stat source package list '%s' (%s)", + I->PackagesInfo().c_str(),File.c_str()); + Missing++; + } + } + // They are certianly out of sync - if (Cache.Head().PackageFileCount != List.size()) + if (Cache.Head().PackageFileCount != List.size() - Missing) return false; for (pkgCache::PkgFileIterator F(Cache); F.end() == false; F++) @@ -572,7 +586,7 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress) { string File = ListDir + URItoFileName(I->PackagesURI()); if (stat(File.c_str(),&Buf) != 0) - return _error->Errno("stat","Couldn't stat source package list %s",File.c_str()); + continue; TotalSize += Buf.st_size; } @@ -584,6 +598,10 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress) for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); I++) { string File = ListDir + URItoFileName(I->PackagesURI()); + + if (stat(File.c_str(),&Buf) != 0) + continue; + FileFd Pkg(File,FileFd::ReadOnly); debListParser Parser(Pkg); Progress.OverallProgress(CurrentSize,TotalSize,Pkg.Size(),"Reading Package Lists"); |