Bug 81969 - Add .tbz to lesspipe.sh and implement lesspipe.d
Add .tbz to lesspipe.sh and implement lesspipe.d
Status: CLOSED DEFERRED
Product: Red Hat Linux
Classification: Retired
Component: less (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
Mike McLean
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-15 16:19 EST by Ville Skyttä
Modified: 2007-04-18 12:50 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-16 10:17:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ville Skyttä 2003-01-15 16:19:05 EST
lesspipe.sh doesn't currently handle *.tbz, a small enhancement... oh, and maybe
*.arj -> unarj and *.lzh,*.lha -> lha (but possibly using the following
suggested enhancement).

But a bigger enhancement would be to implement pluggable handlers into
lesspipe.sh, say if I install unrar, I'd like less to read *.rar archives.  It'd
be nice if there was let's say /etc/lesspipe.d/ for small shell scripts that one
could just drop new handlers into.  The following patch works for me, but may
need some refining.  Following the patch is a source for /etc/lesspipe.d/rar
that adds the *.rar -> unrar functionality.  Please consider implementing this!

--- lesspipe.sh~        2002-06-23 22:50:27.000000000 +0300
+++ lesspipe.sh 2003-01-13 01:24:25.000000000 +0200
@@ -22,13 +22,16 @@
        fi ;;
   *.tar) tar tvvf "$1" ;;
   *.tgz|*.tar.gz|*.tar.[zZ]) tar tzvvf "$1" ;;
-  *.tar.bz2|*.tbz2) bzip2 -dc "$1" | tar tvvf - ;;
+  *.tar.bz2|*.tbz2|*.tbz) bzip2 -dc "$1" | tar tvvf - ;;
   *.[zZ]|*.gz) gzip -dc -- "$1" ;;
   *.bz2) bzip2 -dc -- "$1" ;;
   *.zip) zipinfo -- "$1" ;;
   *.rpm) rpm -qpivl --changelog -- "$1" ;;
   *.cpi|*.cpio) cpio -itv < "$1" ;;
   esac
+  for script in /etc/lesspipe.d/*; do
+    sh "$script" "$1"
+  done
 }


----- source for /etc/lesspipe.d/rar -----

#!/bin/sh -

case "$1" in
    *.rar) unrar l -p- "$1" ;;
esac
Comment 1 Karsten Hopp 2004-11-16 10:17:32 EST
Looks like I can't get some spare time to really implement, and more
important and time consuming, test this. Since the other packages
you've mentioned would need a similar fix to write the scripts in
/etc/lesspipe.d and I have even less time to do that, I'll opt for
DEFERRED and maybe I can pick it up again later. 

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