Selaa lähdekoodia

* another bug in QueueNextDiff fixed

Michael Vogt 21 vuotta sitten
vanhempi
commit
77a7df0e00
2 muutettua tiedostoa jossa 9 lisäystä ja 7 poistoa
  1. 4 2
      apt-pkg/acquire-item.cc
  2. 5 5
      po/apt-all.pot

+ 4 - 2
apt-pkg/acquire-item.cc

@@ -290,10 +290,9 @@ bool pkgAcqIndexDiffs::QueueNextDiff()
    // remove all patches until the next matching patch is found
    // this requires the Index file to be ordered
    for(vector<DiffInfo>::iterator I=available_patches.begin();
-       (*I).sha1 == local_sha1 || I != available_patches.end(); 
+       I != available_patches.end() && (*I).sha1 != local_sha1; 
        I++) 
       available_patches.erase(I);
-   
 
    // error checking and falling back if no patch was found
    if(available_patches.size() == 0) { 
@@ -356,14 +355,17 @@ bool pkgAcqIndexDiffs::ParseIndexDiff(string IndexDiffFile)
       bool found = false;
       while(hist >> d.sha1 >> size >> d.file) {
 	 d.size = atoi(size.c_str());
+	 // read until the first match is found
 	 if(d.sha1 == local_sha1) 
 	    found=true;
+	 // from that point on, we probably need all diffs
 	 if(found) {
 	    if(Debug)
 	       std::clog << "Need to get diff: " << d.file << std::endl;
 	    available_patches.push_back(d);
 	 }
       }
+
       // no information how to get the patches, bail out
       if(!found) {
 	 if(Debug)

+ 5 - 5
po/apt-all.pot

@@ -2251,31 +2251,31 @@ msgstr ""
 msgid "rename failed, %s (%s -> %s)."
 msgstr ""
 
-#: apt-pkg/acquire-item.cc:532 apt-pkg/acquire-item.cc:1197
+#: apt-pkg/acquire-item.cc:537 apt-pkg/acquire-item.cc:1202
 msgid "MD5Sum mismatch"
 msgstr ""
 
-#: apt-pkg/acquire-item.cc:1011
+#: apt-pkg/acquire-item.cc:1016
 #, c-format
 msgid ""
 "I wasn't able to locate a file for the %s package. This might mean you need "
 "to manually fix this package. (due to missing arch)"
 msgstr ""
 
-#: apt-pkg/acquire-item.cc:1064
+#: apt-pkg/acquire-item.cc:1069
 #, c-format
 msgid ""
 "I wasn't able to locate file for the %s package. This might mean you need to "
 "manually fix this package."
 msgstr ""
 
-#: apt-pkg/acquire-item.cc:1100
+#: apt-pkg/acquire-item.cc:1105
 #, c-format
 msgid ""
 "The package index files are corrupted. No Filename: field for package %s."
 msgstr ""
 
-#: apt-pkg/acquire-item.cc:1187
+#: apt-pkg/acquire-item.cc:1192
 msgid "Size mismatch"
 msgstr ""