Browse Source

first proof-of-concept for a fix for #731738

tags/debian/0.9.14.2
Michael Vogt 7 years ago
parent
commit
e5e51967a4
3 changed files with 11 additions and 4 deletions
  1. +1
    -1
      apt-pkg/deb/dpkgpm.cc
  2. +8
    -1
      apt-pkg/install-progress.cc
  3. +2
    -2
      apt-pkg/install-progress.h

+ 1
- 1
apt-pkg/deb/dpkgpm.cc View File

@@ -1182,7 +1182,7 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress)
StartPtyMagic();

// Tell the progress that its starting and fork dpkg
d->progress->Start();
d->progress->Start(d->master);

// this loop is runs once per dpkg operation
vector<Item>::const_iterator I = List.begin();


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

@@ -273,11 +273,18 @@ void PackageManagerFancy::HandleSIGWINCH(int)
SetupTerminalScrollArea(nr_terminal_rows);
}

void PackageManagerFancy::Start()
void PackageManagerFancy::Start(int child_pty)
{
int nr_terminal_rows = GetNumberTerminalRows();
if (nr_terminal_rows > 0)
{
SetupTerminalScrollArea(nr_terminal_rows);
// *cough*
struct winsize win;
ioctl(child_pty, TIOCGWINSZ, (char *)&win);
win.ws_row = nr_terminal_rows - 1;
ioctl(child_pty, TIOCSWINSZ, (char *)&win);
}
}

void PackageManagerFancy::Stop()


+ 2
- 2
apt-pkg/install-progress.h View File

@@ -28,7 +28,7 @@ namespace Progress {
virtual ~PackageManager() {};

/* Global Start/Stop */
virtual void Start() {};
virtual void Start(int child_pty=-1) {};
virtual void Stop() {};

/* When dpkg is invoked (may happen multiple times for each
@@ -125,7 +125,7 @@ namespace Progress {
public:
PackageManagerFancy();
~PackageManagerFancy();
virtual void Start();
virtual void Start(int child_pty=-1);
virtual void Stop();
virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,


Loading…
Cancel
Save