Explorar o código

* apt-pkg/acquire-worker.cc:
- print filename in the unmatching size warning (Closes: #623137)

David Kalnischkies %!s(int64=15) %!d(string=hai) anos
pai
achega
378fcbd65e
Modificáronse 2 ficheiros con 8 adicións e 7 borrados
  1. 5 6
      apt-pkg/acquire-worker.cc
  2. 3 1
      debian/changelog

+ 5 - 6
apt-pkg/acquire-worker.cc

@@ -287,10 +287,10 @@ bool pkgAcquire::Worker::RunMessages()
 	       Log->Pulse(Owner->GetOwner());
 	       Log->Pulse(Owner->GetOwner());
 	    
 	    
 	    OwnerQ->ItemDone(Itm);
 	    OwnerQ->ItemDone(Itm);
-	    if (TotalSize != 0 &&
-		(unsigned)atoi(LookupTag(Message,"Size","0").c_str()) != TotalSize)
-	       _error->Warning("Bizarre Error - File size is not what the server reported %s %lu",
-			       LookupTag(Message,"Size","0").c_str(),TotalSize);
+	    unsigned long const ServerSize = atol(LookupTag(Message,"Size","0").c_str());
+	    if (TotalSize != 0 && ServerSize != TotalSize)
+	       _error->Warning("Size of file %s is not what the server reported %s %lu",
+			       Owner->DestFile.c_str(), LookupTag(Message,"Size","0").c_str(),TotalSize);
 
 
 	    // see if there is a hash to verify
 	    // see if there is a hash to verify
 	    string RecivedHash;
 	    string RecivedHash;
@@ -309,8 +309,7 @@ bool pkgAcquire::Worker::RunMessages()
 		       << endl << endl;
 		       << endl << endl;
 	       }
 	       }
 	    }
 	    }
-	    Owner->Done(Message,atoi(LookupTag(Message,"Size","0").c_str()),
-			RecivedHash.c_str(), Config);
+	    Owner->Done(Message, ServerSize, RecivedHash.c_str(), Config);
 	    ItemDone();
 	    ItemDone();
 	    
 	    
 	    // Log that we are done
 	    // Log that we are done

+ 3 - 1
debian/changelog

@@ -40,8 +40,10 @@ apt (0.8.14.2) UNRELEASED; urgency=low
   * test/versions.lst:
   * test/versions.lst:
     - disable obscure version number tests with versions dpkg doesn't
     - disable obscure version number tests with versions dpkg doesn't
       allow any more as they don't start with a number
       allow any more as they don't start with a number
+  * apt-pkg/acquire-worker.cc:
+    - print filename in the unmatching size warning (Closes: #623137)
 
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Tue, 26 Apr 2011 19:30:12 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Tue, 26 Apr 2011 22:36:53 +0200
 
 
 apt (0.8.14.1) unstable; urgency=low
 apt (0.8.14.1) unstable; urgency=low