Hi!

On Sun, 2017-02-26 at 17:40:52 +0100, Harald Dunkel wrote:
> Package: dpkg
> Version: 1.18.22

> Moving from Jessie to Stretch in a chroot I stumbled over this:

> :
> :
> Setting up libsoprano4 (2.9.4+dfsg-5) ...
> Setting up libnepomuk4 (4:4.14.26-1) ...
> Setting up libprocps6:amd64 (2:3.3.12-3) ...
> Setting up procps (2:3.3.12-3) ...
> Installing new version of config file /etc/init.d/procps ...
> 
> Configuration file '/etc/sysctl.conf'
>  ==> Modified (by you or by a script) since installation.
>  ==> Package distributor has shipped an updated version.
>    What would you like to do about it ?  Your options are:
>     Y or I  : install the package maintainer's version
>     N or O  : keep your currently-installed version
>       D     : show the differences between the versions
>       Z     : start a shell to examine the situation
>  The default action is to keep your current version.
> *** sysctl.conf (Y/I/N/O/D/Z) [default=N] ? d
> sh: /usr/bin/less: No such file or directory

> PAGER is set to /usr/bin/less, of course, but IMHO dpkg
> should fall back to /usr/bin/more if ${PAGER} fails to
> exec.

I've been a bit undecided about this report. One one hand a PAGER set
to a non-existent program will make most tools that use that environment
variable to fail (at least from my enquiry on codesearch.debian.net).
Also dpkg already defaults to "pager" when the PAGER envvar is unset.

OTOH, finding oneself in the middle of an upgrade that PAGER is
wrongly set, means you cannot nicely recover, and would have to deal
with all prompts being unable to diff the conffiles. (Well you can
Ctrl+C and the «dpkg --configure --pending», but that might break the
apt transaction which might include other batched installations.)

So making dpkg more robust in that sense might be nicer. But it would
paper over other programs also failing. And would require having to
hardcode a list of pagers, which is never nice. So perhaps what I
should do is check whether the program pointed by PAGER exists on
startup.

Would that have helped you in this case? Or was less removed during
the upgrade?

Thanks,
Guillem

Reply via email to