Просмотр исходного кода

send "dpkg-exec" message on the status fd when dpkg is run

Michael Vogt лет назад: 17
Родитель
Сommit
ccd8e28fe1
2 измененных файлов с 10 добавлено и 0 удалено
  1. 9 0
      apt-pkg/deb/dpkgpm.cc
  2. 1 0
      debian/changelog

+ 9 - 0
apt-pkg/deb/dpkgpm.cc

@@ -839,6 +839,15 @@ bool pkgDPkgPM::Go(int OutStatusFd)
        // Fork dpkg
        // Fork dpkg
       pid_t Child;
       pid_t Child;
       _config->Set("APT::Keep-Fds::",fd[1]);
       _config->Set("APT::Keep-Fds::",fd[1]);
+      // send status information that we are about to fork dpkg
+      if(OutStatusFd > 0) {
+	 ostringstream status;
+	 status << "pmstatus:dpkg-exec:" 
+		<< (PackagesDone/float(PackagesTotal)*100.0) 
+		<< ":" << _("Running dpkg")
+		<< endl;
+	 write(OutStatusFd, status.str().c_str(), status.str().size());
+      }
       Child = ExecFork();
       Child = ExecFork();
             
             
       // This is the child
       // This is the child

+ 1 - 0
debian/changelog

@@ -16,6 +16,7 @@ apt (0.7.21) UNRELEASED; urgency=low
   * apt-pkg/deb/dpkgpm.cc:
   * apt-pkg/deb/dpkgpm.cc:
     - add Dpkg::UseIoNice boolean option to run dpkg with ionice -c3
     - add Dpkg::UseIoNice boolean option to run dpkg with ionice -c3
       (off by default)
       (off by default)
+    - send "dpkg-exec" message on the status fd when dpkg is run
 
 
  -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 28 May 2009 17:51:42 +0200
  -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 28 May 2009 17:51:42 +0200