On Tue, 29 May 2012 16:05:25 +0530This patch basically avoids explicitly setting PAGER=/usr/bin/pager before running say 'perf list' on the system where less is not installed.
Avik Sil<avik.sil@xxxxxxxxxx> wrote:
Some Distributions may lack "less" package being included by default, e.g., Linaro nano rootfs. In those cases use the portable "pager" command instead of "less".
Signed-off-by: Avik Sil<avik.sil@xxxxxxxxxx>
---
tools/perf/util/pager.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/perf/util/pager.c b/tools/perf/util/pager.c
index 1915de2..3322b84 100644
--- a/tools/perf/util/pager.c
+++ b/tools/perf/util/pager.c
@@ -57,6 +57,10 @@ void setup_pager(void)
}
if (!pager)
pager = getenv("PAGER");
+ if (!pager) {
+ if (!access("/usr/bin/pager", X_OK))
+ pager = "/usr/bin/pager";
+ }
What is "portable" about /usr/bin/pager ? and what is wrong with just
doing
export PAGER=/usr/bin/pager