[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#185424: base-config: Should display progress bar while installing packages



On Thu, Jun 02, 2005 at 01:49:58PM -0400, Daniel Burrows wrote:
> On Thursday 02 June 2005 08:52 am, Colin Watson wrote:
> > One tricky bit is that we have to use 'aptitude search' first to figure
> > out how long the progress bar needs to be, and then pass some hairy
> > arguments to aptitude to get dpkg --status-fd information. If aptitude
> > had some way to output progress bar information to a given file
> > descriptor, that would be more efficient, especially if it could process
> > dpkg --status-fd information itself.
> >
> > We'd want a line on the file descriptor telling us how long the progress
> > bar should be, and then lines each time the progress bar text or
> > position should be updated, and probably a line at the end. The text
> > should be tokens rather than English strings, so that they can be
> > localised using debconf templates. debootstrap does this sort of thing
> > in its --debian-installer interaction mode.
> >
> > Daniel, does this seem tractable to you? I don't know aptitude very
> > well, but I may be able to hack on it a bit.
> 
>   Hm, the progress bar is used to indicate progress in the process of 
> installing packages, right?  I think that this doesn't belong (entirely) in 
> the aptitude layer; at the very least, apt should be responsible for keeping 
> track of how much progress has been made in installing packages.  This should 
> be done by using an instance of the OpProgress class, which could then be 
> specialized to provide output in whatever format you want (the specialization 
> might make more sense in aptitude, but then again it sounds generically 
> useful enough that you might want to put it into apt).

I put some code into apt that should make it possible to get usefull
install progress reports. It's in
michael.vogt@ubuntu.com--2005/apt--progress-reporting--0  [1]

If the apt options: "APT::Status-Fd" is set, apt will send status
reports to that fd. The status fd reports have the following format:

status:pkgname:TotalPercentage:action-description

with 
status = {"status", "conffile-prompt", "error" } [2]
pkgname = the name of the package
TotalPercentage = the total progress between [0..100] 
action-description = a i18ned human readable decription of the current
                     action

Example:
# ./apt-get install -o APT::Status-Fd=2 3dchess >/dev/null
status:3dchess:20:Preparing 3dchess
status:3dchess:40:Unpacking 3dchess
status:3dchess:60:Preparing to configure 3dchess
status:3dchess:80:Configuring 3dchess
status:3dchess:100:Installed 3dchess


The reason for using a fd instead of a OpProgress class is that many
apt frontend fork a (vte) terminal for the actual installation.

The reason to do the mapping and l10n of the dpkg states to human
readable (and translatable) strings is that this way the translation
needs to be done only once for all frontends.

Suggestions/corrections are welcome :)

Cheers,
 Michael


[1] at http://people.ubuntu.com/~mvo/arch/ubuntu
[2] "conffile-prompt", "error" will work only with dpkg-1.13 (and when
    I actually implement them in the apt code)
-- 
Linux is not The Answer. Yes is the answer. Linux is The Question. - Neo



Reply to: