summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-09-01 18:33:26 +0200
committerMichael Vogt <mvo@debian.org>2013-09-01 18:33:26 +0200
commitc2ffd51cdc4b3343aa38f3ce58153d4e6338983c (patch)
tree64fa83edecc36dfa788c1075c9f48503893a054c
parent3cc29bc2cc37f194bb90ae6ae5c467f230f1d5d2 (diff)
parent98b69f9dd0ced02b01e276041635c7bb7f2484e3 (diff)
Merge branch 'debian/sid' of ssh://git.debian.org/git/apt/apt into debian/sid
-rw-r--r--apt-pkg/contrib/fileutl.cc2
-rw-r--r--apt-pkg/deb/dpkgpm.cc17
-rw-r--r--apt-pkg/deb/dpkgpm.h2
3 files changed, 19 insertions, 2 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 4806ae3f9..3966eb0ed 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -977,7 +977,7 @@ bool FileFd::Open(string FileName,unsigned int const Mode,APT::Configuration::Co
if((iFd = mkstemp(name)) == -1)
{
free(name);
- return FileFdErrno("mkostemp", "Could not create temporary file for %s", FileName.c_str());
+ return FileFdErrno("mkstemp", "Could not create temporary file for %s", FileName.c_str());
}
TemporaryFileName = string(name);
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 4b5467eff..3c1013761 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -632,6 +632,9 @@ void pkgDPkgPM::ProcessDpkgStatusLine(int OutStatusFd, char *line)
<< ":" << (PackagesDone/float(PackagesTotal)*100.0)
<< ":" << s
<< endl;
+ if(_config->FindB("DPkgPM::Progress", false) == true)
+ SendTerminalProgress(PackagesDone/float(PackagesTotal)*100.0);
+
if(OutStatusFd > 0)
FileFd::Write(OutStatusFd, status.str().c_str(), status.str().size());
if (Debug == true)
@@ -874,6 +877,18 @@ bool pkgDPkgPM::CloseLog()
return true;
}
/*}}}*/
+// DPkgPM::SendTerminalProgress /*{{{*/
+// ---------------------------------------------------------------------
+/* Send progress info to the terminal
+ */
+void pkgDPkgPM::SendTerminalProgress(float percentage)
+{
+ // FIXME: use colors too
+ std::cout << "\r\n"
+ << "Progress: [" << percentage << "%]"
+ << "\r\n";
+}
+ /*}}}*/
/*{{{*/
// This implements a racy version of pselect for those architectures
// that don't have a working implementation.
@@ -1294,7 +1309,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
FileFd::Write(OutStatusFd, status.str().c_str(), status.str().size());
}
Child = ExecFork();
-
+
// This is the child
if (Child == 0)
{
diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h
index c31d56f8e..29901a204 100644
--- a/apt-pkg/deb/dpkgpm.h
+++ b/apt-pkg/deb/dpkgpm.h
@@ -84,6 +84,8 @@ class pkgDPkgPM : public pkgPackageManager
bool SendPkgsInfo(FILE * const F, unsigned int const &Version);
void WriteHistoryTag(std::string const &tag, std::string value);
+ void SendTerminalProgress(float percentage);
+
// apport integration
void WriteApportReport(const char *pkgpath, const char *errormsg);