diff mbox series

less: set PAGER variable

Message ID 20190902133955.9541-1-lkundrak@v3.sk
State Changes Requested
Headers show
Series less: set PAGER variable | expand

Commit Message

Lubomir Rintel Sept. 2, 2019, 1:39 p.m. UTC
The system/skeleton/etc/profile sets PAGER to /bin/more. Not sure why,
but this defeats pager autodetection by various tool (systemctl, nmcli,
etc.) that would otherwise prefer less to more.

Let's override the PAGER variable if the user chooses to install the less
package.
---
 package/less/less.mk | 2 ++
 1 file changed, 2 insertions(+)

Comments

Thomas Petazzoni Sept. 3, 2019, 8:38 a.m. UTC | #1
Hello,

On Mon,  2 Sep 2019 15:39:55 +0200
Lubomir Rintel <lkundrak@v3.sk> wrote:

> The system/skeleton/etc/profile sets PAGER to /bin/more. Not sure why,
> but this defeats pager autodetection by various tool (systemctl, nmcli,
> etc.) that would otherwise prefer less to more.

Perhaps we should simply remove the PAGER definition in etc/profile, then ?

In any case, your patch lacks an SoB.

Thanks,

Thomas
Lubomir Rintel Sept. 6, 2019, 9:24 a.m. UTC | #2
On Tue, 2019-09-03 at 10:38 +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Mon,  2 Sep 2019 15:39:55 +0200
> Lubomir Rintel <lkundrak@v3.sk> wrote:
> 
> > The system/skeleton/etc/profile sets PAGER to /bin/more. Not sure why,
> > but this defeats pager autodetection by various tool (systemctl, nmcli,
> > etc.) that would otherwise prefer less to more.
> 
> Perhaps we should simply remove the PAGER definition in etc/profile, then ?

That indeed seems to be a better idea.

> In any case, your patch lacks an SoB.
> 
> Thanks,
> 
> Thomas

Thanks
Lubo
diff mbox series

Patch

diff --git a/package/less/less.mk b/package/less/less.mk
index ef3643c0aa..1981e4b8b6 100644
--- a/package/less/less.mk
+++ b/package/less/less.mk
@@ -12,6 +12,8 @@  LESS_DEPENDENCIES = ncurses
 
 define LESS_INSTALL_TARGET_CMDS
 	$(INSTALL) -m 0755 $(@D)/less $(TARGET_DIR)/usr/bin/less
+	mkdir -p $(TARGET_DIR)/etc/profile.d
+	echo "export PAGER='/bin/less'" > $(TARGET_DIR)/etc/profile.d/less.sh
 endef
 
 $(eval $(autotools-package))