]> git.saurik.com Git - apt.git/commitdiff
flush line-clearing on progress stop before post-invoke
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 10 Mar 2016 12:06:29 +0000 (13:06 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Mon, 14 Mar 2016 10:47:19 +0000 (11:47 +0100)
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
apt-pkg/install-progress.cc
test/integration/test-failing-maintainer-scripts

index 14409e301437c5b1c9ae434b12d6fca09a5720fa..f1a9f42dc4b40af47654a891261ab220272bcd5b 100644 (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;
 }
index 781d06e5c11e66cf3eb1e2fc4734ccf5a3d6bf9b..8cf2380eeb485beea5169f1765d1a34efc6ea051 100755 (executable)
@@ -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