Bug 718498 - RFE: lesspipe.sh could use a support for *.xz files
Summary: RFE: lesspipe.sh could use a support for *.xz files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: less
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Vojtech Vitek
QA Contact: Petr Šplíchal
URL:
Whiteboard:
Depends On: 556602
Blocks: 743047
TreeView+ depends on / blocked
 
Reported: 2011-07-03 15:51 UTC by Dan Kenigsberg
Modified: 2016-06-01 01:42 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of: 556602
Environment:
Last Closed: 2011-12-06 12:01:37 UTC
Target Upstream Version:


Attachments (Terms of Use)
Proposed patch (1.92 KB, patch)
2011-07-14 16:01 UTC, Vojtech Vitek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1575 0 normal SHIPPED_LIVE less bug fix and enhancement update 2011-12-06 00:39:01 UTC

Description Dan Kenigsberg 2011-07-03 15:51:42 UTC
Since bug 716962, rhev moved to compressing its log files with `xz`.
less-436-4.el6 not being able to easily see them makes our debugging more cumbersome.

+++ This bug was initially created as a clone of Bug #556602 +++

Description of problem:

With xz as as "standard utility" in Fedora and tar recognizing -J option it would be nice if lesspipe.sh would know what to do with files/archives compressed that way.  xz is similar in use to gzip and bz2.

--- Additional comment from npajkovs on 2010-01-20 11:42:48 IST ---

Created attachment 385635 [details]
lesspipe.sh

I have added new *.xz into lesspipe.sh. Please install build http://koji.fedoraproject.org/koji/taskinfo?taskID=1933411 or you can download attachment and copy it into /usr/bin(there is lesspipe.sh)

--- Additional comment from michal on 2010-01-21 04:08:55 IST ---

(In reply to comment #1)

> I have added new *.xz into lesspipe.sh.

Not quite, I guess.  Instead of
  *.xz) tar Jtvvf "$1" ;;
like now it should be, IMO:
  *.tar.xz) tar Jtvvf "$1" ;;
  *.xz) xz -dc  -- "$1" ;;
similar to other compress programs.  Also it looks like that you forgot
the following change:
--- ./lesspipe.sh.orig  2010-01-20 02:30:01.000000000 -0700
+++ ./lesspipe.sh       2010-01-20 18:32:16.000000000 -0700
@@ -43,6 +43,7 @@
        case "$1" in
                *.gz)   DECOMPRESSOR="gunzip -c" ;;
                *.bz2)  DECOMPRESSOR="bunzip2 -c" ;;
+               *.xz)   DECOMPRESSOR="unxz -c" ;;
        esac
        if [ ! -z $DECOMPRESSOR ] ; then
                $DECOMPRESSOR -- "$1" ;


It is true that currently manpages are not compressed with xz but, once at this, I think that I would add on line 8 of lesspipe.sh all patterns which would be needed to handle such cases.  Just the same as all ".gz" patterns repeated with ".xz" instead.  It may come handy in the future and does not mess anything for now.

BTW - "*.tar.bz2" is processed with a pipe to tar instead of '-j' tar flag.  It really does not matter that much but maybe some consistency across different cases would be good?

--- Additional comment from michal on 2010-01-21 04:10:17 IST ---

Created attachment 385829 [details]
proposed patch to the lesspipe.sh from koji

--- Additional comment from michal on 2010-01-21 04:36:35 IST ---

Looking at patterns for manpage handling I only now noticed that one may have
.n suffix, and .n.bz2 but not .n.gz and I repeated that for .xz in my patch.
OTOH files from /usr/share/man/man?x directories are handled if they are gzip
compressed (and with xz with my patch) but not if bzip2 was used.  Still manpages from /usr/share/man[013]p/ directories are not covered by any pattern.  Weird.
I guess that this should be fixed too.

--- Additional comment from npajkovs on 2010-01-21 15:57:24 IST ---

aaaahaaaa we are talking about manpages. I thought that you want to see file list with less not what is inside files. Yep that make sense.

--- Additional comment from michal on 2010-01-21 18:06:46 IST ---

(In reply to comment #5)
> aaaahaaaa we are talking about manpages.  

Not really.  Look closer.  manpages came up as an aside when I started checking what really happens in lesspipe.sh.  In attachment (id=385829) only the first chunk is for that, and as I wrote later not really complete, and the remaining chunks are "general".  I thought that comment #2 should be clear enough.  Just omit there a paragraph starting with "It is true ..." if you will.

--- Additional comment from npajkovs on 2010-01-21 19:02:50 IST ---

Ok I'm fully in the picture. I will apply patch soon and put there new build and lesspipe.sh(or patch)

--- Additional comment from npajkovs on 2010-01-21 21:45:35 IST ---

Created attachment 385994 [details]
lesspipe.sh

new lesspipe.sh and build http://koji.fedoraproject.org/koji/taskinfo?taskID=1936796

--- Additional comment from updates on 2010-02-01 13:16:43 IST ---

less-436-6.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/less-436-6.fc12

--- Additional comment from updates on 2010-02-02 03:16:55 IST ---

less-436-6.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update less'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-1342

--- Additional comment from updates on 2010-02-20 02:06:50 IST ---

less-436-6.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 1 RHEL Program Management 2011-07-06 00:32:28 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 4 RHEL Program Management 2011-07-06 14:09:09 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 7 Vojtech Vitek 2011-07-14 16:01:01 UTC
Created attachment 513213 [details]
Proposed patch

Patch adds less read support for following file types:
*.xz, *.lzma (both for compressed man pages as well)
*.jar, *.nbm

Comment 15 errata-xmlrpc 2011-12-06 12:01:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1575.html


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