]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire.cc
test: Allow db_dump-5 instead of db_dump
[apt.git] / apt-pkg / acquire.cc
index 7a44d859913d76ab2dcdfcef6e0142f7056182a0..33c98cf2e7527539cbdcc4eae5f1609606388953 100644 (file)
@@ -466,7 +466,7 @@ void pkgAcquire::SetFds(int &Fd,fd_set *RSet,fd_set *WSet)
 void pkgAcquire::RunFds(fd_set *RSet,fd_set *WSet)
 {
    RunFdsSane(RSet, WSet);
-};
+}
                                                                        /*}}}*/
 // Acquire::RunFdsSane - Deal with active FDs                          /*{{{*/
 // ---------------------------------------------------------------------
@@ -1258,13 +1258,12 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
         snprintf(msg,sizeof(msg), _("Retrieving file %li of %li"), i, TotalItems);
 
       // build the status str
-      status << "dlstatus:" << i
-             << ":"  << std::setprecision(3) << Percent
-             << ":" << msg
-             << endl;
-
-      std::string const dlstatus = status.str();
-      FileFd::Write(fd, dlstatus.c_str(), dlstatus.size());
+      std::ostringstream str;
+      str.imbue(std::locale::classic());
+      str.precision(4);
+      str << "dlstatus" << ':' << std::fixed << i << ':' << Percent << ':' << msg << '\n';
+      auto const dlstatus = str.str();
+      FileFd::Write(fd, dlstatus.data(), dlstatus.size());
    }
 
    return true;