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

Peter Kjellerstedt peter.kjellerstedt at axis.com
Tue Jun 20 13:39:34 UTC 2017


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<mailto: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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20170620/992fbc60/attachment-0002.html>


More information about the bitbake-devel mailing list