Browse Source

* merged from apt--mvo

Michael Vogt 19 years ago
parent
commit
829baeeaf3
2 changed files with 16 additions and 7 deletions
  1. 12 7
      apt-pkg/deb/dpkgpm.cc
  2. 4 0
      debian/changelog

+ 12 - 7
apt-pkg/deb/dpkgpm.cc

@@ -624,15 +624,20 @@ bool pkgDPkgPM::Go(int OutStatusFd)
 	    
 	    
 	 */
 	 */
 	 char* list[5];
 	 char* list[5];
-	 if(!TokSplitString(':', line, list, sizeof(list)/sizeof(list[0])))
-	    // FIXME: dpkg sends multiline error messages sometimes (see
-	    //        #374195 for a example. we should support this by
-	    //        either patching dpkg to not send multiline over the
-	    //        statusfd or by rewriting the code here to deal with
-	    //        it. for now we just ignore it and not crash
-	    continue;
+	 //        dpkg sends multiline error messages sometimes (see
+	 //        #374195 for a example. we should support this by
+	 //        either patching dpkg to not send multiline over the
+	 //        statusfd or by rewriting the code here to deal with
+	 //        it. for now we just ignore it and not crash
+	 TokSplitString(':', line, list, sizeof(list)/sizeof(list[0]));
 	 char *pkg = list[1];
 	 char *pkg = list[1];
 	 char *action = _strstrip(list[2]);
 	 char *action = _strstrip(list[2]);
+	 if( pkg == NULL || action == NULL) 
+	 {
+	    if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
+	       std::clog << "ignoring line: not enough ':'" << std::endl;
+	    continue;
+	 }
 
 
 	 if(strncmp(action,"error",strlen("error")) == 0)
 	 if(strncmp(action,"error",strlen("error")) == 0)
 	 {
 	 {

+ 4 - 0
debian/changelog

@@ -1,5 +1,9 @@
 apt (0.6.46.3) unstable; urgency=low
 apt (0.6.46.3) unstable; urgency=low
 
 
+  * apt-pkg/deb/dpkgpm.cc:
+    - make progress reporting robust against multiline error
+      messages 
+
   * Merged from Christian Perrier bzr branch:
   * Merged from Christian Perrier bzr branch:
     - ca.po: Updated to 514t
     - ca.po: Updated to 514t
     - be.po: Updated to 514t
     - be.po: Updated to 514t