]> git.saurik.com Git - apt.git/commitdiff
Merge remote-tracking branch 'upstream/debian/sid' into bugfix/bts-726156-2
authorMichael Vogt <mvo@debian.org>
Tue, 15 Oct 2013 15:54:31 +0000 (17:54 +0200)
committerMichael Vogt <mvo@debian.org>
Tue, 15 Oct 2013 15:54:31 +0000 (17:54 +0200)
1  2 
apt-pkg/deb/dpkgpm.cc

diff --combined apt-pkg/deb/dpkgpm.cc
index 61d8eec02962671b7188fdfb87e0f0e182aff941,1fbeabbdcd9b6f0df98ef2321ae993d768312ff5..d18900b9c0fa3ef4149bc557988191e26cff873f
@@@ -546,8 -546,8 +546,8 @@@ void pkgDPkgPM::ProcessDpkgStatusLine(i
     // A dpkg error message may contain additional ":" (like
     //  "failed in buffer_write(fd) (10, ret=-1): backend dpkg-deb ..."
     // so we need to ensure to not split too much
-    std::vector<std::string> list = StringSplit(line, ": ", 3);
-    if(list.size() != 3)
+    std::vector<std::string> list = StringSplit(line, ": ", 4);
+    if(list.size() < 3)
     {
        if (Debug == true)
         std::clog << "ignoring line: not enough ':'" << std::endl;
     std::string pkgname = list[1];
     if (pkgname.find(":") == std::string::npos)
     {
 -      string const nativeArch = _config->Find("APT::Architecture");
 -      pkgname = pkgname + ":" + nativeArch;
 +      // find the package in the group that is in a touched by dpkg
 +      // if there are multiple dpkg will send us a full pkgname:arch
 +      pkgCache::GrpIterator Grp = Cache.FindGrp(pkgname);
 +      if (Grp.end() == false) 
 +      {
 +          pkgCache::PkgIterator P = Grp.PackageList();
 +          for (; P.end() != true; P = Grp.NextPkg(P))
 +          {
 +              if(Cache[P].Mode != pkgDepCache::ModeKeep)
 +              {
 +                  pkgname = P.FullName();
 +                  break;
 +              }
 +          }
 +      }
     }
     const char* const pkg = pkgname.c_str();
     const char* action = list[2].c_str();
 +   
 +   std::string short_pkgname = StringSplit(pkgname, ":")[0];
  
     // 'processing' from dpkg looks like
     // 'processing: action: pkg'
        PackageOpsDone[pkg]++;
        PackagesDone++;
        // build the status str
 -      status << "pmstatus:" << pkg 
 +      status << "pmstatus:" << short_pkgname
             << ":"  << (PackagesDone/float(PackagesTotal)*100.0) 
             << ":" << s
             << endl;
         std::clog << "send: '" << status.str() << "'" << endl;
     }
     if (Debug == true) 
 -      std::clog << "(parsed from dpkg) pkg: " << pkg 
 +      std::clog << "(parsed from dpkg) pkg: " << short_pkgname
                << " action: " << action << endl;
  }
                                                                        /*}}}*/
@@@ -916,7 -901,7 +916,7 @@@ void pkgDPkgPM::SendTerminalProgress(fl
        return;
  
     std::string progress_str;
-    strprintf(progress_str, "Progress: [%3i%%]", (int)percentage);
+    strprintf(progress_str, _("Progress: [%3i%%]"), (int)percentage);
     if (d->fancy_progress_output)
     {
           int row = d->nr_terminal_rows;