Bug#492861: Progress bar rewinds when running pre-pkgsel.d/10popcon
On Friday 01 August 2008, Jérémy Bobbio wrote:
> As far as my imagination goes, the problem in this approach lies in the
> debconf-apt-progress interface. It takes:
> --from <start position> --to <end position>
>
> debconf-apt-progress is used (at least) by the popcon pre-pkgsel.d
> script. So we would at least need to change the way pre-pkgsel.d
> scripts are called to give them their allocated start and end position
> on the progress bar.
Yes, those values should be passed as envvars which is the easiest way to
make them available when it is not sure they are needed. Hook scripts
that call d-a-p can then just use the range assigned to them and for
scripts that don't an envvar is harmless.
> I have moved away from this approach for the proposed one to support
> the idea, already present in the current pkgsel postinst, that a step
> that would do nothing should not take space in the progress bar
> (pkgsel/include).
If you want to do that then using hook scripts is IMO just not the correct
solution. Compare base-installer which explicitly sets the progress bar
range when it defines its steps.
> Another point is that the proposed approach makes it easy to support
> scripts that want control on their progress bar and those who do not.
> Having a script echoing back a new position is an easy way to determine
> that it did move the progress bar forward. In your approach, we could
> always add a "db_progress SET" once they have been called to cope with
> scripts which did not, but well, it not as elegant, IMHO.
IMO it's the only correct thing to do. In all other cases where we use
hook scripts we advance the progress bar by some fixed amount per hook
script. The only additional feature here is that some hook scripts can
usefully subdivide their allotted bit.
> I can understand that. I pondered it for a while and the only thing
> that could be broken with a broken script would be the progress bar.
No, see my reply to Otavio. A hook script can trivially blow up the whole
postinst.
> If we don't agree to something, we can always remove the
> usage of debconf-apt-progress in the popcon script.
I don't see why we would want to do that.
Reply to: