diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:56:58 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:56:58 +0000 |
commit | a77ad7c3ce8c8621936d3527a967ef36a361bc71 (patch) | |
tree | e199466880cb24e9d3c9d79c199d56ed2dcca7b3 /apt-pkg | |
parent | 721e08d670a6579561389e4302c874f17676ec11 (diff) |
Work better if there are duplicate sources.list entries.
Author: jgg
Date: 2001-03-04 00:12:41 GMT
Work better if there are duplicate sources.list entries.
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 2fcccaf4a..a245f9fdf 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.46 2001/02/20 07:03:17 jgg Exp $ +// $Id: pkgcachegen.cc,v 1.47 2001/03/04 00:12:41 jgg Exp $ /* ###################################################################### Package Cache Generator - Generator for the cache structure. @@ -492,10 +492,10 @@ static bool CheckValidity(string CacheFile,pkgIndexFile **Start, SPtrArray<bool> Visited = new bool[Cache.HeaderP->PackageFileCount]; memset(Visited,0,sizeof(*Visited)*Cache.HeaderP->PackageFileCount); for (; Start != End; Start++) - { + { if ((*Start)->HasPackages() == false) continue; - + if ((*Start)->Exists() == false) { _error->WarningE("stat",_("Couldn't stat source package list %s"), @@ -558,6 +558,13 @@ static bool BuildCache(pkgCacheGenerator &Gen, if ((*Start)->Exists() == false) continue; + if ((*Start)->FindInCache(Gen.GetCache()).end() == false) + { + _error->Warning("Duplicate sources.list entry %s", + (*Start)->Describe().c_str()); + continue; + } + unsigned long Size = (*Start)->Size(); Progress.OverallProgress(CurrentSize,TotalSize,Size,_("Reading Package Lists")); CurrentSize += Size; @@ -580,7 +587,7 @@ static bool BuildCache(pkgCacheGenerator &Gen, bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, MMap **OutMap,bool AllowMem) { - unsigned long MapSize = _config->FindI("APT::Cache-Limit",4*1024*1024); + unsigned long MapSize = _config->FindI("APT::Cache-Limit",6*1024*1024); vector<pkgIndexFile *> Files(List.begin(),List.end()); unsigned long EndOfSource = Files.size(); |