std::flush(std::cout);
}
+void pkgDPkgPM::CleanupTerminal()
+{
+ // reset scroll area
+ SetupTerminalScrollArea(d->nr_terminal_rows + 1);
+ if(d->fancy_progress_output)
+ {
+ // override the progress line (sledgehammer)
+ static const char* clear_screen_below_cursor = "\033[J";
+ std::cout << clear_screen_below_cursor;
+ std::flush(std::cout);
+ }
+}
+
+
// DPkgPM::Go - Run the sequence /*{{{*/
// ---------------------------------------------------------------------
/* This globs the operations and calls dpkg
if (fcntl(STDIN_FILENO,F_SETFL,Flags & (~(long)O_NONBLOCK)) < 0)
_exit(100);
}
+ // setup terminal
SetupTerminalScrollArea(d->nr_terminal_rows);
+ SendTerminalProgress(PackagesDone/float(PackagesTotal)*100.0);
/* No Job Control Stop Env is a magic dpkg var that prevents it
from using sigstop */
signal(SIGHUP,old_SIGHUP);
- // reset scroll area
- SetupTerminalScrollArea(d->nr_terminal_rows + 1);
- if(d->fancy_progress_output)
- {
- // override the progress line (sledgehammer)
- static const char* clear_screen_below_cursor = "\033[J";
- std::cout << clear_screen_below_cursor;
- }
-
if(master >= 0)
{
tcsetattr(0, TCSAFLUSH, &tt);
if(stopOnError)
{
CloseLog();
+ CleanupTerminal();
return false;
}
}
if(_config->FindB("DPkgPM::Progress", false) == true)
SendTerminalProgress(100);
+ CleanupTerminal();
+
if (pkgPackageManager::SigINTStop)
_error->Warning(_("Operation was interrupted before it could finish"));
// Terminal progress
void SetupTerminalScrollArea(int nr_scrolled_rows);
void SendTerminalProgress(float percentage);
+ void CleanupTerminal();
// apport integration
void WriteApportReport(const char *pkgpath, const char *errormsg);