Bug 666084 - No longer displays original file when input pipe script produces no output
Summary: No longer displays original file when input pipe script produces no output
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: less
Version: 14
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: ---
Assignee: Vojtech Vitek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-28 21:15 UTC by Matt McCutchen
Modified: 2015-03-04 23:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-21 09:15:46 UTC


Attachments (Terms of Use)

Description Matt McCutchen 2010-12-28 21:15:06 UTC
Description of problem:
The behavior of "less" has changed to not show the original file when an input pipe script ("lesspipe.sh") produces no output.  The script must exit nonzero for the original file to be shown.  This is a superior design, and it makes bug 615303 go away, but it breaks third-party input pipe scripts.  IMO, this is not an acceptable trade-off under the updates policy for a stable release (https://fedoraproject.org/wiki/Updates_Policy#Stable_Releases).  The man page was not updated either.

Version-Release number of selected component (if applicable):
less-436-8.fc14

How reproducible:
Always

Steps to Reproduce:
1. Copy the example lesspipe.sh script from the man page to the current directory.
2. echo foo >file
3. LESSOPEN="|$PWD/lesspipe.sh" less file
  
Actual results:
An empty file is displayed.

Expected results:
"foo" is displayed.

Comment 1 Vojtech Vitek 2011-01-03 10:16:17 UTC
Thank you for the report, Matt. I should have changed man page example as well, sorry for that.
I am discussing the changes with upstream developer right now, so I will let you know about the resolution.

Comment 2 Vojtech Vitek 2011-01-10 13:47:18 UTC
Matt, do you know any 3rd party package that ships it's own modified LESSOPEN variable (and which value begins with pipe character)?

$ repoquery --whatrequires --alldeps less | sed 's/\([a-zA-Z-]*\)-[0-9]*.*/\1/' | sort | uniq
backup-manager
calc
colordiff
firehol
git
GMT
gzip
less
man-db
octave
R-core

I have found just one LESSOPEN modification in those packages:
zless.in:56:LESSOPEN="|gzip -cdfq -- %s"; export LESSOPEN
- and this works OK, as it returns exit status of gzip program itself.

Comment 3 Matt McCutchen 2011-01-10 14:06:10 UTC
No.  The third party input pipe script in question is one that I wrote and installed manually on my system.  Obviously it is not part of Fedora.  But the behavior change to "less" broke a documented API, which is discouraged under the updates policy.  In my view, bug 615303 is a nit and does not justify such breakage.

Comment 4 Todd Zullinger 2011-01-13 19:01:53 UTC
I just got bitten by this as well in Fedora 13.  I've had my own lesspipe.sh script for years and was surprised to see it break after the recent less update.  I'd never run into the bug that the update fixed either, FWIW.

Comment 5 Fedora Update System 2011-02-15 14:49:27 UTC
less-436-10.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/less-436-10.fc14

Comment 6 Fedora Update System 2011-02-15 14:50:33 UTC
less-436-9.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/less-436-9.fc13

Comment 7 Vojtech Vitek 2011-02-15 15:38:39 UTC
Fixed in less-436-12.fc16, less-436-12.fc15, less-436-10.fc14 and less-436-9.fc13.

Can you guys confirm there is no other regression?

Comment 8 Fedora Update System 2011-02-18 15:05:30 UTC
less-436-12.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/less-436-12.fc15

Comment 9 Fedora Update System 2011-02-21 07:30:47 UTC
less-436-10.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2011-03-03 02:59:50 UTC
less-436-12.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2011-04-02 22:48:40 UTC
less-436-9.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


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