Browse Source

flush line-clearing on progress stop before post-invoke

All other interactions with std::cout are flushed directly, just in the
stop case we hadn't done it – no problem expect if there is still output
coming after apt is done like in the case of a post-invoke script
producing output.

Closes: 793672
tags/debian/1.2.7
David Kalnischkies 5 years ago
parent
commit
915f4ac6d9
2 changed files with 6 additions and 2 deletions
  1. +1
    -0
      apt-pkg/install-progress.cc
  2. +5
    -2
      test/integration/test-failing-maintainer-scripts

+ 1
- 0
apt-pkg/install-progress.cc View File

@@ -333,6 +333,7 @@ void PackageManagerFancy::Stop()
// override the progress line (sledgehammer)
static const char* clear_screen_below_cursor = "\033[J";
std::cout << clear_screen_below_cursor;
std::flush(std::cout);
}
child_pty = -1;
}


+ 5
- 2
test/integration/test-failing-maintainer-scripts View File

@@ -84,5 +84,8 @@ testdpkginstalled failure-postrm
testmyfailure aptget purge failure-postrm -y

# FIXME: test with output going to a PTY as it usually does
#cp -a rootdir/var/lib/dpkg/status.backup rootdir/var/lib/dpkg/status
#aptget install failure-preinst -y
if false; then
cp -a rootdir/var/lib/dpkg/status.backup rootdir/var/lib/dpkg/status
apt install dependee -y || true
apt install failure-postinst -y || true
fi

Loading…
Cancel
Save