[bitbake-devel] [PATCH] bitbake : Paginate 'bitbake -e' using less.

Rob Woolley rob.woolley at windriver.com
Mon Jun 26 21:02:20 UTC 2017


Feel free to grab pieces from here, if you find it useful:
https://patchwork.openembedded.org/patch/89543/

I based it on the same logic used by git to determine whether the user had
a pager set already and whether or not the output was going to the terminal
or being piped to another process.

The feedback I got was that the functionality wasn't needed and users could
just pipe it to less if they wanted a pager:
http://lists.openembedded.org/pipermail/bitbake-devel/2015-March/005545.html

Regards,
Rob

On Mon, Jun 26, 2017 at 4:48 PM, Diana Thayer <garbados at gmail.com> wrote:

> Thank you for the feedback!
>
> I've added lines to check $OE_PAGER and $PAGER, such that `PAGER=cat
> bitbake -e` effectively disables pagination.
>
> Regarding the option '--paginate', would it capture output from whatever
> command has run? I'm not sure how to capture stdout at such a scope.
>
>
> On Tue, Jun 20, 2017 at 6:39 AM, Peter Kjellerstedt <
> peter.kjellerstedt at axis.com> wrote:
>
>> Basically, this change needs to be aware of the destination for the
>> output. If it is a tty, then it is fine to output to a viewer such as less,
>> but otherwise it should go to stdout as before. This should of course not
>> be hardcoded, but use environment variables, e.g., $OE_PAGER || $PAGER ||
>> less (inspired by git_pager() in the git source). You should also not
>> expect that everyone wants the options you have used for less. Looking
>> again at how git handles this, they use “LESS=FRX <command>” if the $LESS
>> environment variable is not set, and does not modify it if it is set. You
>> also want to add options such as --paginate and --no-pager (yet again
>> inspired by git) to bitbake.
>>
>>
>>
>> All in all, look at and be inspired by how git handles pagers, they have
>> this pretty well covered.
>>
>>
>>
>> //Peter
>>
>>
>>
>> *From:* bitbake-devel-bounces at lists.openembedded.org [mailto:
>> bitbake-devel-bounces at lists.openembedded.org] *On Behalf Of *Burton, Ross
>> *Sent:* den 20 juni 2017 12:06
>> *To:* Diana Thayer <garbados at gmail.com>
>> *Cc:* bitbake-devel <bitbake-devel at lists.openembedded.org>
>> *Subject:* Re: [bitbake-devel] [PATCH] bitbake : Paginate 'bitbake -e'
>> using less.
>>
>>
>>
>>
>>
>> On 20 June 2017 at 05:54, Diana Thayer <garbados at gmail.com> wrote:
>>
>> +        pager = subprocess.Popen(['less', '-F', '-R', '-S', '-X', '-K'],
>> +                                 stdin=subprocess.PIPE,
>> +                                 stdout=sys.stdout,
>> +                                 universal_newlines=True)
>>
>>
>> What if I'm piping bitbake -e though grep or into a file already?
>>
>>
>>
>> Ross
>>
>
>
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20170626/e43f85ee/attachment-0002.html>


More information about the bitbake-devel mailing list