namespace APT {
namespace Progress {
+
+/* Return a APT::Progress::PackageManager based on the global
+ * apt configuration (i.e. APT::Status-Fd and APT::Status-deb822-Fd)
+ */
PackageManager* PackageManagerProgressFactory()
{
// select the right progress
FileFd::Write(OutStatusFd, s.c_str(), s.size());
}
-void PackageManagerProgressFd::Start()
+void PackageManagerProgressFd::StartDpkg()
{
if(OutStatusFd <= 0)
return;
void PackageManagerProgressFd::Stop()
{
- // clear the Keep-Fd again
- _config->Clear("APT::Keep-Fds", OutStatusFd);
}
void PackageManagerProgressFd::Error(std::string PackageName,
FileFd::Write(OutStatusFd, s.c_str(), s.size());
}
-void PackageManagerProgressDeb822Fd::Start()
+void PackageManagerProgressDeb822Fd::StartDpkg()
{
// FIXME: use SetCloseExec here once it taught about throwing
// exceptions instead of doing _exit(100) on failure
void PackageManagerProgressDeb822Fd::Stop()
{
- // clear the Keep-Fd again
- _config->Clear("APT::Keep-Fds", OutStatusFd);
}
void PackageManagerProgressDeb822Fd::Error(std::string PackageName,
static const char *move_cursor_up = "\033[1A";
std::cout << move_cursor_up;
+ // setup env for (hopefully!) ncurses
+ string s;
+ strprintf(s, "%i", nr_rows);
+ setenv("LINES", s.c_str(), 1);
+
std::flush(std::cout);
}