From c23e6cd58242470daad78ddad85285f9cd7aed0f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 12 Dec 2013 15:11:01 +0100 Subject: Fix conffile prompt regression (LP: #1260297) This fixes a regression in the conffile prompt for the progress-fd and adds a testcase to ensure this does not regress again. --- apt-pkg/deb/dpkgpm.cc | 10 +++++++--- apt-pkg/install-progress.cc | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index b4bfd1400..0d73733d5 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -44,6 +44,7 @@ #include #include #include +#include #include /*}}}*/ @@ -596,7 +597,7 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line) 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 + 'status:/etc/compiz.conf/compiz.conf : conffile-prompt: 'current-conffile' 'new-conffile' useredited distedited */ if (prefix == "status") { @@ -608,7 +609,7 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line) WriteApportReport(list[1].c_str(), list[3].c_str()); return; } - else if(action == "conffile") + else if(action == "conffile-prompt") { d->progress->ConffilePrompt(list[1], PackagesDone, PackagesTotal, list[3]); @@ -1036,7 +1037,10 @@ void pkgDPkgPM::StartPtyMagic() if (tcgetattr(STDOUT_FILENO, &d->tt) == 0) { ioctl(1, TIOCGWINSZ, (char *)&win); - if (openpty(&d->master, &d->slave, NULL, &d->tt, &win) < 0) + if (_config->FindB("Dpkg::Use-Pty", true) == false) + { + d->master = d->slave = -1; + } else if (openpty(&d->master, &d->slave, NULL, &d->tt, &win) < 0) { _error->Errno("openpty", _("Can not write log (%s)"), _("Is /dev/pts mounted?")); d->master = d->slave = -1; diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index b82b7efde..0caf62b61 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -9,7 +9,7 @@ #include #include #include - +#include namespace APT { namespace Progress { -- cgit v1.2.3