]> git.saurik.com Git - apt.git/commitdiff
* merged with apt--main
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 9 Aug 2005 08:48:41 +0000 (08:48 +0000)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 9 Aug 2005 08:48:41 +0000 (08:48 +0000)
Patches applied:

 * apt@packages.debian.org/apt--main--0--patch-109
   Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0

 * apt@packages.debian.org/apt--main--0--patch-110
   Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0

 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-29
   * changelog finalized

 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-30
   * propper (and sane) support for pmerror and pmconffile added

README.progress-reporting
apt-pkg/deb/dpkgpm.cc
configure.in
debian/apt-doc.docs [new file with mode: 0644]
debian/changelog

index 7ae5149293f0743cf09bce258ef8386d2c9383e1..73fbd8c0877a9ba90a29992d65b18a7cc02900cd 100644 (file)
@@ -34,6 +34,19 @@ pmstatus:3dchess:60:Preparing to configure 3dchess
 pmstatus:3dchess:80:Configuring 3dchess
 pmstatus:3dchess:100:Installed 3dchess
 
+pmerror
+-------
+pmerror:deb:TotalPercentage:error string
+
+Example:
+pmerror: /var/cache/apt/archives/krecipes_0.8.1-0ubuntu1_i386.deb : 75% : trying to overwrite `/usr/share/doc/kde/HTML/en/krecipes/krectip.png', which is also in package krecipes-data 
+
+
+pmconffile
+----------
+pmconffile:conffile:percent:'current-conffile' 'new-conffile' useredited distedited
+
+
 
 dlstatus
 --------
index 79a8c312bd9c399f6f8c7ccc2ba694cfe0ef5a44..fe8fbca748b5fc05b63bda2be3ff86881983a58a 100644 (file)
@@ -612,20 +612,49 @@ bool pkgDPkgPM::Go(int OutStatusFd)
         if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
            std::clog << "got from dpkg '" << line << "'" << std::endl;
 
-        // pass "error" and "conffile-prompt" messages from dpkg verbatim
-        if((strncmp(line,"error",strlen("error")) == 0) ||
-           (strncmp(line,"conffile-prompt",strlen("conffile-prompt")) == 0))
-        {
-              write(OutStatusFd, line, strlen(line));
-              line[0]=0;
-              continue;
-        }
-        // line contains the dpkg status info now. it has the form:
-        // 'status:   <pkg>:  <pkg  qstate>' (see dpkg(1) for details)
-        char* list[5];
+        // the status we output
+        ostringstream status;
+
+        /* dpkg sends strings like this:
+           'status:   <pkg>:  <pkg  qstate>'
+           errors look like this:
+           'status: /var/cache/apt/archives/krecipes_0.8.1-0ubuntu1_i386.deb : error : trying to overwrite `/usr/share/doc/kde/HTML/en/krecipes/krectip.png', which is also in package krecipes-data 
+           and conffile-prompt like this
+           'status: conffile-prompt: conffile : 'current-conffile' 'new-conffile' useredited distedited
+           
+        */
+        char* list[4];
         TokSplitString(':', line, list, 5);
         char *pkg = list[1];
-        char *action = list[2];
+        char *action = _strstrip(list[2]);
+
+        if(strncmp(action,"error",strlen("error")) == 0)
+        {
+           status << "pmerror:" << list[1]
+                  << ":"  << (Done/float(Total)*100.0) 
+                  << ":" << list[3]
+                  << endl;
+           if(OutStatusFd > 0)
+              write(OutStatusFd, status.str().c_str(), status.str().size());
+           line[0]=0;
+           if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
+              std::clog << "send: '" << status.str() << "'" << endl;
+           continue;
+        }
+        if(strncmp(action,"conffile",strlen("conffile")) == 0)
+        {
+           status << "pmconffile:" << list[1]
+                  << ":"  << (Done/float(Total)*100.0) 
+                  << ":" << list[3]
+                  << endl;
+           if(OutStatusFd > 0)
+              write(OutStatusFd, status.str().c_str(), status.str().size());
+           line[0]=0;
+           if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
+              std::clog << "send: '" << status.str() << "'" << endl;
+           continue;
+        }
+
         vector<struct DpkgState> &states = PackageOps[pkg];
         const char *next_action = NULL;
         if(PackageOpsDone[pkg] < states.size())
@@ -642,7 +671,6 @@ bool pkgDPkgPM::Go(int OutStatusFd)
            // we moved from one dpkg state to a new one, report that
            PackageOpsDone[pkg]++;
            Done++;
-           ostringstream status;
            // build the status str
            status << "pmstatus:" << pkg 
                   << ":"  << (Done/float(Total)*100.0) 
@@ -651,11 +679,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
            if(OutStatusFd > 0)
               write(OutStatusFd, status.str().c_str(), status.str().size());
            if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
-           {
-              std::clog << "send to fd: '" << status.str() 
-                        << "'" << std::endl;
-              
-           }
+              std::clog << "send: '" << status.str() << "'" << endl;
 
         }
         if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true) 
index 7e3aba331575e4617b4f35ef05f79aa4ffe4f5fe..1ee7e168b3d12dce19e60cfe91537ab11dbe7cf9 100644 (file)
@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.6.40")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.40.2")
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)
diff --git a/debian/apt-doc.docs b/debian/apt-doc.docs
new file mode 100644 (file)
index 0000000..a7507f4
--- /dev/null
@@ -0,0 +1 @@
+README.progress-reporting
\ No newline at end of file
index 8bad1ba96de4a8690a8aef5cfb33dbae5017c96f..35cba60079a05dadd35fa9c530ac0696adab1bae 100644 (file)
@@ -1,3 +1,11 @@
+apt (0.6.40.2) unstable; urgency=low
+
+  * improved the support for "error" and "conffile" reporting from
+    dpkg, added the format to README.progress-reporting
+  * added README.progress-reporting to the apt-doc package
+
+ --
+
 apt (0.6.40.1ubuntu1) breezy; urgency=low
 
   * Synchronize with Debian