Bug 34892 - lesspipe not loaded in bash
Summary: lesspipe not loaded in bash
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA9-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2025-12-23 11:40 CET by Marc Krämer
Modified: 2025-12-29 22:13 CET (History)
4 users (show)

See Also:
Source RPM: less-678-1.1.mga9.src.rpm
CVE:
Status comment:


Attachments

Description Marc Krämer 2025-12-23 11:40:18 CET
I encounter since some time lesspipe is not working anymore.

I've checked where it is loaded:
/etc/profile.d/20less.sh

But the bash-condition never evaluates to true - I am not sure what this should mean:
[ -z "|/usr/bin/lesspipe.sh %s" ] 

test -z checks the argument to be zero length - why whould this have zero length???

Since this condtions fails no export of LESSOPEN is done.
Comment 1 Lewis Smith 2025-12-23 20:47:06 CET
The filter is  called  from  less  provided  the  environment  variable
       LESSOPEN is set properly. For ksh like shells (bash, zsh) the command
              LESSOPEN="|lesspipe.sh %s"; export LESSOPEN
       does  activate  the  filter  for less. Use the fully qualified path, if
       lesspipe.sh is not in the search path. The command to set LESSOPEN  can
       also  be  displayed by calling lesspipe.sh without arguments.

(In reply to Marc Krämer from comment #0)
> I encounter since some time lesspipe is not working anymore.
The file /etc/profile.d/20less.sh comes from 'less', which SRPM was changed for Mageia 9: May 7 2025 - new version 678 and lesspipe 2.18
Does this correspond with with your "since some time"?

In Cauldron, the 678 SRPM was updated twice:
May 10 07:44:26 2025 UTC (7 months, 2 weeks ago) by papoteur
- do not define LESSCHARSET env variable anymore (mga#34251)
May 30 11:33:10 2025 UTC (6 months, 3 weeks ago) by wally
- fix lesspipe b0rked in r2182291
I do not know whether these were applied to M9, but doubt it because the 678 pkg version is shown 1.1.

Assigning globally, CC'ing the packagers concerned.

Assignee: bugsquad => pkg-bugs
Source RPM: less => less-678-1.1.mga9.src.rpm
CC: (none) => jani.valimaa, yves.brungard

Comment 2 Jani Välimaa 2025-12-26 11:49:41 CET
Should be fixed with less-678-1.2.mga9 in core/updates_testing. Please test.

Assignee: pkg-bugs => qa-bugs

Comment 3 katnatek 2025-12-26 17:35:24 CET
What will be the way to test before/after the update?

Keywords: (none) => feedback

Comment 4 Jani Välimaa 2025-12-27 11:54:03 CET
Simple as:
$ echo $LESSOPEN
$ less <some.rpm>

The latter should list the content of the .rpm.
Comment 5 Marc Krämer 2025-12-27 12:00:38 CET
Great works. And -z "$LESSOPEN" looks better than before. So a given LESSOPEN is not overwritten
Comment 6 katnatek 2025-12-28 02:17:00 CET
Before the update

echo $LESSOPEN

less rpm/RPMS/noarch/zapzap-5.3.9-1.mga9.noarch.rpm 
"rpm/RPMS/noarch/zapzap-5.3.9-1.mga9.noarch.rpm" may be a binary file.  See it anyway? 

installing less-678-1.2.mga9.x86_64.rpm from //home/katnatek/qa-testing/x86_64
Preparing...                     ###################################################################################################
      1/1: less                  ###################################################################################################
      1/1: removing less-678-1.1.mga9.x86_64
                                 ###################################################################################################
----------------------------------------------------------------------
More information on package less-678-1.2.mga9.x86_64
This version of less includes lesspipe.sh from Wolfgang Friebel
( https://www-zeuthen.desy.de/~friebel//unix/less/ ).

This enables you to view gz, bz2, lzma, zip, rpm and html files
among others with less. It works by setting the LESSOPEN 
environment variable, see the man pages for details.

If you want to disable this behavior, either use 'unset LESSOPEN' or
use an alias ( alias less='less -l' ).

less will open html files with lynx, then html2text, then cat if
none of the previous were found.

----------------------------------------------------------------------

Looks like the minimal action to this make effect is close and open the terminal emulator in use

echo $LESSOPEN
||/usr/bin/lesspipe.sh %s

less rpm/RPMS/noarch/zapzap-5.3.9-1.mga9.noarch.rpm 


==> (lesspipe 2.18) use rpm_file:contained_file to view a file in the archive
Name        : zapzap
Version     : 5.3.9
Release     : 1.mga9
Architecture: noarch
Install Date: (not installed)
Group       : Unspecified
Size        : 855793
License     : GNU General Public License v3.0
Signature   : (none)
Source RPM  : zapzap-5.3.9-1.mga9.src.rpm
Build Date  : lun 10 nov 2025 18:49:47
Build Host  : jgrey.phoenix
URL         : https://github.com/rafatosta/zapzap
Summary     : Zapzap - WhatsApp Messenger for Linux
Description :
Zapzap - WhatsApp Messenger for Linux
=================================== Contents ===================================
-rwxr-xr-x  1 0      0         218 nov 10 18:49 ./usr/bin/zapzap
drwxr-xr-x  1 0      0           0 nov 10 18:49 ./usr/lib/python3.10/site-packages/zapzap
drwxr-xr-x  1 0      0           0 nov 10 18:49 ./usr/lib/python3.10/site-packages/zapzap-5.3.dist-info
-rw-r--r--  1 0      0           4 nov 10 18:49 ./usr/lib/python3.10/site-packages/zapzap-5.3.dist-info/INSTALLER
-rw-r--r--  1 0      0       35129 nov 10 18:49 ./usr/lib/python3.10/site-packages/zapzap-5.3.dist-info/LICENSE
-rw-r--r--  1 0      0         545 nov 10 18:49 ./usr/lib/python3.10/site-packages/zapzap-5.3.dist-info/METADATA
-rw-r--r--  1 0      0          92 nov 10 18:49 ./usr/lib/python3.10/site-packages/zapzap-5.3.dist-info/WHEEL
-rw-r--r--  1 0      0          44 nov 10 18:49 ./usr/lib/python3.10/site-packages/zapzap-5.3.dist-info/entry_points.txt
-rw-r--r--  1 0      0           7 nov 10 18:49 ./usr/lib/python3.10/site-packages/zapzap-5.3.dist-info/top_level.txt

And more

Good to me

Keywords: feedback => (none)
Whiteboard: (none) => MGA9-64-OK

katnatek 2025-12-28 02:27:33 CET

Keywords: (none) => advisory
CC: (none) => andrewsfarm

Comment 7 Thomas Andrews 2025-12-28 03:26:37 CET
Validating.

Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs

Comment 8 Mageia Robot 2025-12-29 22:13:24 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2025-0107.html

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.