]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-worker.cc
Czech program translation update
[apt.git] / apt-pkg / acquire-worker.cc
index 2c84020fe03696e9d8b02669f3075c92df1a0fb3..176772dde47d5c93a75bc0449390cbf7f56cd201 100644 (file)
@@ -26,7 +26,6 @@
 #include <string>
 #include <vector>
 #include <iostream>
-#include <sstream>
 
 #include <sys/stat.h>
 #include <stdlib.h>
@@ -34,9 +33,7 @@
 #include <signal.h>
 #include <stdio.h>
 #include <errno.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <grp.h>
+#include <sstream>
 
 #include <apti18n.h>
                                                                        /*}}}*/
@@ -338,9 +335,10 @@ bool pkgAcquire::Worker::RunMessages()
               for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O)
                  Log->Pulse((*O)->GetOwner());
 
-           std::string const filename = LookupTag(Message, "Filename", Itm->Owner->DestFile.c_str());
            HashStringList ReceivedHashes;
            {
+              std::string const givenfilename = LookupTag(Message, "Filename");
+              std::string const filename = givenfilename.empty() ? Itm->Owner->DestFile : givenfilename;
               // see if we got hashes to verify
               for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type)
               {
@@ -361,11 +359,11 @@ bool pkgAcquire::Worker::RunMessages()
                     ReceivedHashes = calc.GetHashStringList();
                  }
               }
-           }
 
-           // only local files can refer other filenames and counting them as fetched would be unfair
-           if (Log !=  NULL && filename != Itm->Owner->DestFile)
-              Log->Fetched(ReceivedHashes.FileSize(),atoi(LookupTag(Message,"Resume-Point","0").c_str()));
+              // only local files can refer other filenames and counting them as fetched would be unfair
+              if (Log != NULL && Itm->Owner->Complete == false && Itm->Owner->Local == false && givenfilename == filename)
+                 Log->Fetched(ReceivedHashes.FileSize(),atoi(LookupTag(Message,"Resume-Point","0").c_str()));
+           }
 
            std::vector<Item*> const ItmOwners = Itm->Owners;
            OwnerQ->ItemDone(Itm);
@@ -538,7 +536,7 @@ bool pkgAcquire::Worker::MediaChange(string Message)
       ostringstream msg,status;
       ioprintf(msg,_("Please insert the disc labeled: "
                     "'%s' "
-                    "in the drive '%s' and press enter."),
+                    "in the drive '%s' and press [Enter]."),
               Media.c_str(),Drive.c_str());
       status << "media-change: "  // message
             << Media  << ":"     // media