← Back to team overview

linaro-pkg team mailing list archive

Re: [Bug 833101] Re: perf uses less at the default pager, but the linux-tools packages have no dependency for it

 

On Thu, May 10, 2012 at 12:30:52PM -0000, Avik Sil wrote:
> Does this patch look OK?
> 
> diff --git a/tools/perf/util/pager.c b/tools/perf/util/pager.c
> index 1915de2..d6f23de 100644
> --- a/tools/perf/util/pager.c
> +++ b/tools/perf/util/pager.c
> @@ -57,8 +57,12 @@ void setup_pager(void)
>         }
>         if (!pager)
>                 pager = getenv("PAGER");
> -       if (!pager)
> -               pager = "less";
> +       if (!pager) {
> +               if (!access("/usr/bin/pager", X_OK))
> +                       pager = "/usr/bin/pager";
> +               else
> +                       pager = "less";

To conform to the existing code style, you might want to write the code
as follows:

+	if (!pager) {
+		if (!access("/usr/bin/pager", X_OK))
+			pager = "/usr/bin/pager";
+	}
+	if (!pager)
+		pager = "less";

Functionally, the code looks OK to me either way.

Cheers
---Dave

-- 
You received this bug notification because you are a member of Linaro
Maintainers, which is the registrant for Linaro Linux.
https://bugs.launchpad.net/bugs/833101

Title:
  perf uses less at the default pager, but the linux-tools packages have
  no dependency for it

Status in Linaro Ubuntu Evaluation Builds:
  Fix Released
Status in Linaro Linux:
  New
Status in “linux” package in Ubuntu:
  In Progress
Status in “linux-linaro” package in Ubuntu:
  New

Bug description:
  $ perf list
  sh: less: not found

  This only affects minimal installs which don't have less installed.

  Observed in:
   * linux-tools-2.6.38-11 (2.6.38-11.48) in the Ubuntu archive, running under natty (11.04)
   * linux-linaro-tools-3.0.0-1004 (3.0.0-1004.5~ppa~natty) from the linaro overlay PPA, from the 11.08 release.

  The issue probably affects all packages containing the perf tool.

  This could be fixed:

  a) in linux (preferably upstream), by changing perf's default pager to more if less is absent
  b) in debian/ubuntu, by changing perf's default pager to /usr/bin/pager or more
  c) in debian/ubuntu by allowing util-linux to provide /usr/bin/less as an alternative using more.
  d) in linux-meta by adding Depends: less (if believed to be acceptable)

To manage notifications about this bug go to:
https://bugs.launchpad.net/linaro-ubuntu/+bug/833101/+subscriptions


References