Преглед изворни кода

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.

Arch Librarian пре 22 година
родитељ
комит
a77ad7c3ce
2 измењених фајлова са 14 додато и 6 уклоњено
  1. 11 4
      apt-pkg/pkgcachegen.cc
  2. 3 2
      debian/changelog

+ 11 - 4
apt-pkg/pkgcachegen.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // 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.
    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];
    SPtrArray<bool> Visited = new bool[Cache.HeaderP->PackageFileCount];
    memset(Visited,0,sizeof(*Visited)*Cache.HeaderP->PackageFileCount);
    memset(Visited,0,sizeof(*Visited)*Cache.HeaderP->PackageFileCount);
    for (; Start != End; Start++)
    for (; Start != End; Start++)
-   {
+   {      
       if ((*Start)->HasPackages() == false)
       if ((*Start)->HasPackages() == false)
 	 continue;
 	 continue;
-      
+    
       if ((*Start)->Exists() == false)
       if ((*Start)->Exists() == false)
       {
       {
 	 _error->WarningE("stat",_("Couldn't stat source package list %s"),
 	 _error->WarningE("stat",_("Couldn't stat source package list %s"),
@@ -558,6 +558,13 @@ static bool BuildCache(pkgCacheGenerator &Gen,
       if ((*Start)->Exists() == false)
       if ((*Start)->Exists() == false)
 	 continue;
 	 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();
       unsigned long Size = (*Start)->Size();
       Progress.OverallProgress(CurrentSize,TotalSize,Size,_("Reading Package Lists"));
       Progress.OverallProgress(CurrentSize,TotalSize,Size,_("Reading Package Lists"));
       CurrentSize += Size;
       CurrentSize += Size;
@@ -580,7 +587,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
 bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
 bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
 			MMap **OutMap,bool AllowMem)
 			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());
    vector<pkgIndexFile *> Files(List.begin(),List.end());
    unsigned long EndOfSource = Files.size();
    unsigned long EndOfSource = Files.size();

+ 3 - 2
debian/changelog

@@ -6,7 +6,7 @@ apt (0.5.1) unstable; urgency=low
   * Ignore .* for configuration directory processing. Closes: #86923
   * Ignore .* for configuration directory processing. Closes: #86923
   * Alfredo's no_proxy patch
   * Alfredo's no_proxy patch
   * Documentation fixes. Closes: #87091
   * Documentation fixes. Closes: #87091
-  * JoeyH's double slash bug
+  * JoeyH's double slash bug. Closes: #87266
   * Unintitialized buffer and apt-ftparchive contents generation. 
   * Unintitialized buffer and apt-ftparchive contents generation. 
      Closes: #87612
      Closes: #87612
   * Build-deps on virtual packages. Closes: #87639
   * Build-deps on virtual packages. Closes: #87639
@@ -19,7 +19,8 @@ apt (0.5.1) unstable; urgency=low
   * Dan's segfault
   * Dan's segfault
   * Some instances where the status file can source a package in a
   * Some instances where the status file can source a package in a
     non-sensical way. Closes: #87390
     non-sensical way. Closes: #87390
-    
+  * Work better if there are duplicate sources.list entries.
+  
  -- Jason Gunthorpe <jgg@debian.org>  Thu, 22 Feb 2001 00:39:15 -0500
  -- Jason Gunthorpe <jgg@debian.org>  Thu, 22 Feb 2001 00:39:15 -0500
 
 
 apt (0.5.0) unstable; urgency=low
 apt (0.5.0) unstable; urgency=low