Bug#221728: progress display does not work in chroot w/o /proc mounted
On Wed, Nov 19, 2003 at 03:08:59PM -0500, Joey Hess wrote:
> When I run apt in a chroot without /proc mounted, I notice that it does
> not display the usual progress info when downloading packages. I only
> see one line per packages downloaded, at the end of the download. If I
> mount /proc, I get the standard behavor of a constatly updated progress
> display. No big deal, but:
> [...]
> So it starts the download but as it is not displaying progress, so can
> then sit for an arbitrarily long period of time before displaying any
> indication that the user's input was accepted. This is not good UI design
> in my opionion. (Neither is "Yes, do as I say", when upgrading a
> library, but I digress..)
>
> I wish the progress display could just be fixed to work on systems where
> whatever it looks for in /proc is not available.
All that apt needs to know is whether it is talking to a tty or not. It
currently uses ttyname(3) in this instance; I would guess that if it used
isatty(3) instead, it would work without /proc.
Would you mind giving it a try to see? Change cmdline/apt-get.cc:2471 from:
if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1)
to:
if (isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1)
--
- mdz
Reply to: