fix PTY interaction on linux and kfreebsd
authorDavid Kalnischkies <david@kalnischkies.de>
Mon, 17 Nov 2014 23:59:39 +0000 (00:59 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Fri, 28 Nov 2014 15:15:39 +0000 (16:15 +0100)
commit299aea924ccef428219ed6f1a026c122678429e6
tree4fb0f2fe7de3d697561e1fe1298c739ee4dea4fa
parent9fc0b435593839de47098212f0ae5f15b6263099
fix PTY interaction on linux and kfreebsd

We run dpkg on its own pty, so we can log its output and have our own
output around it (like the progress bar), while also allowing debconf
and configfile prompts to happen.

In commit 223ae57d468fdcac451209a095047a07a5698212 we changed to
constantly reopening the slave for kfreebsd. This has the sideeffect
though that in some cases slave and master will lose their connection on
linux, so that no output is passed along anymore. We fix this by having
always an fd referencing the slave open (linux), but we don't use it
(kfreebsd).

Failing to get our PTY up and running has many (bad) consequences
including (not limited to, nor all at ones or in any case) garbled ouput,
no output, no logging, a (partial) mixture of the previous items, …
This commit is therefore also reshuffling quiet a bit of the creation
code to get especially the output part up and running on linux and the
logging for kfreebsd.

Note that the testcase tries to cover some cases, but this is an
interactivity issue so only interactive usage can really be a good test.

Closes: 765687
apt-pkg/deb/dpkgpm.cc
test/integration/test-no-fds-leaked-to-maintainer-scripts