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

Re: Bug#363250: general: Custom PAGER gives error on sid, but works on sarge



On 22 Apr 2006, Loïc Minier outgrape:

> On Sat, Apr 22, 2006, Manoj Srivastava wrote:
>> There are two use cases that any pager directive must address:
>> 1) The program is going to generate output which must be piped to
>> a pager
>> 2) The program want to send a file to the user.

> I agree that these use cases need to be supported.

>> But perhaps the policy for Debian should be for programs to ignore
>> PAGER and just use sensible pager, where all the logic for dealing
>> with pager goes in. I still don't see how sensible pager can handle
>> the pipeline vs the non-pipeline case, though.

> Yes, I believe the policy should be changed in this way, and as I
> proposed.

        Hmm.  This could be a potentially disruptive change -- since a
 lot of programs may need to be changed in non-trivial ways.

> Look at the code of sensible-pager, it will call "$PAGER" if
> sensible-pager is called without any argument, and "$PAGER
> <filename>" if it's called as "sensible-pager <filename>".  This
> seems good enough for me; if people set $PAGER to a pipeline, they
> might suffer from problems for the second case, but we can work on
> that.

        Err, so we can't make this policy (allowing $PAGER to be a
 pipeline) until we have a solution for this, given that we have
 agreed that the two use cases for $PAGER must be  feasible.


>> Barring that, policy would have to be that programs can' t user
>> PAGER to work with use case 2, and must be guilty of an "useless
>> use of cat" to pipe data to STDIN for PAGER.

> Yes, if you mean that permitting pipelines forbids programs to call
> "$PAGER $file", I agree with you.  There are multiple ways to solve
> this, but I think that whatever way is chosen should be implemented
> in sensible-pager, and we can even change our mind later, and fix
> only sensible-pager.  The contract of sensible-pager with respect to
> Debian programs should be to offer two modes of operation, the pipe
> of data on stdin mode, and the pass a file on the command line mode
> (matching your use cases 1 and 2).

>> PAGER has the benefit of being long standardized, and if we do
>> not use PAGER, we are breaking user expectations.
>> What is the benefit of creating a PAGER clone?

> sensible-pager is not a PAGER clone, it permits us to enhance the
> handling of $PAGER in a single place instead of changing every
> program in Debian that wants to send something to $PAGER.

        The point is that lots of programs already respect $PAGER,
 with varying semantics (most support $PAGER being less or more or
 something, but not all support arbitary pipelines.


>>> B/ user configuration of the pager When defined, $PAGER is a sh
>>> pipeline which reads its data from stdin.
>> How do programs present a text file to the user using a PAGER,
>> then? cat file.txt | $PAGER?

> That's a question for sensible-pager to solve, but one way is to use
> cat "$@" | $PAGER indeed.

        Umm. If we are talking about making policy, we can't just make
 policy and say things are a problem for some package or the other to
 solve.

>> In other words, ignore $PAGER, use sensible-pager all over,
>> and let that handle it?
>
> Yes.
>
>> Not, unless these questions are answered, and we actually have
>> a working implementation.
>
> Well the current implementation works, except for pipelines.  :)

        Since allowing pipelines seems to be the motivating factor
 here, we do need to solve that, I think.

        manoj
-- 
I am here by the will of the people and I won't leave until I get my
raincoat back.- a slogan of the anarchists in Richard Kadrey's
"Metrophage"
Manoj Srivastava   <srivasta@debian.org>  <http://www.debian.org/%7Esrivasta/>
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C



Reply to: