]> git.saurik.com Git - apt.git/commitdiff
add APT::Progress::PackageManager::Pulse()
authorMichael Vogt <mvo@debian.org>
Sun, 13 Oct 2013 13:10:53 +0000 (15:10 +0200)
committerMichael Vogt <mvo@debian.org>
Sun, 13 Oct 2013 13:10:53 +0000 (15:10 +0200)
apt-pkg/deb/dpkgpm.cc
apt-pkg/iprogress.h

index 0c3be4ce5162438a284f076a040feb9de786f2ad..d617a3c0c314b805b248c0fb0fa479d7209751f6 100644 (file)
@@ -1364,13 +1364,14 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
         FD_SET(_dpkgin, &rfds);
         if(master >= 0)
            FD_SET(master, &rfds);
-        tv.tv_sec = 1;
-        tv.tv_nsec = 0;
+        tv.tv_sec = 0;
+        tv.tv_nsec = d->progress->GetPulseInterval();
         select_ret = pselect(max(master, _dpkgin)+1, &rfds, NULL, NULL, 
                              &tv, &original_sigmask);
         if (select_ret < 0 && (errno == EINVAL || errno == ENOSYS))
            select_ret = racy_pselect(max(master, _dpkgin)+1, &rfds, NULL,
                                      NULL, &tv, &original_sigmask);
+         d->progress->Pulse();
         if (select_ret == 0) 
            continue;
         else if (select_ret < 0 && errno == EINTR)
index 6519e9445f467c13b42a1616397154d41dcbf13b..04520ffe8df9b8c4044f3cc6e7f540673d9447b7 100644 (file)
@@ -28,7 +28,12 @@ namespace Progress {
     virtual void Finished() {};
 
     virtual pid_t fork() {return fork(); };
-    
+
+    virtual void Pulse() {};
+    virtual long GetPulseInterval() {
+         return 500000;
+    };
+
     virtual bool StatusChanged(std::string PackageName, 
                                unsigned int StepsDone,
                                unsigned int TotalSteps,