summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Robbins <drobbins@gentoo.org>2002-01-07 04:05:30 +0000
committerDaniel Robbins <drobbins@gentoo.org>2002-01-07 04:05:30 +0000
commit4bd7c0370d52fe8ebd0caa06ed7c6e1ea1283bd4 (patch)
tree00a684339f39b658adf10e7534c19b18760d735c /sys-apps/less
parentadded symlinks to close bug #50 (diff)
downloadgentoo-2-4bd7c0370d52fe8ebd0caa06ed7c6e1ea1283bd4.tar.gz
gentoo-2-4bd7c0370d52fe8ebd0caa06ed7c6e1ea1283bd4.tar.bz2
gentoo-2-4bd7c0370d52fe8ebd0caa06ed7c6e1ea1283bd4.zip
new less, closing bug #22
Diffstat (limited to 'sys-apps/less')
-rw-r--r--sys-apps/less/files/lesspipe.sh-r141
-rw-r--r--sys-apps/less/less-371-r1.ebuild (renamed from sys-apps/less/less-371.ebuild)4
2 files changed, 43 insertions, 2 deletions
diff --git a/sys-apps/less/files/lesspipe.sh-r1 b/sys-apps/less/files/lesspipe.sh-r1
new file mode 100644
index 000000000000..a647ac1b51b1
--- /dev/null
+++ b/sys-apps/less/files/lesspipe.sh-r1
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# Preprocessor for 'less'. Used when this environment variable is set:
+# LESSOPEN="|lesspipe.sh %s"
+
+lesspipe() {
+
+ case "$1" in
+
+ *.tar.bz2) tar tjvvf $1 2>/dev/null ;;
+ *.bz2) bzip2 -dc $1 2>/dev/null ;;
+ *.tar) tar tvvf $1 2>/dev/null ;;
+ *.tbz2) tar tjvvf $1 2>/dev/null ;;
+ *.tbz) tar tjvvf $1 2>/dev/null ;;
+ *.tar.gz) tar tzvvf $1 2>/dev/null ;;
+ *.tgz) tar tzvvf $1 2>/dev/null ;;
+ *.tar.z) tar tzvvf $1 2>/dev/null ;;
+ *.tar.Z) tar tzvvf $1 2>/dev/null ;;
+ *.z) gzip -dc $1 2>/dev/null ;;
+ *.Z) gzip -dc $1 2>/dev/null ;;
+ *.zip) unzip -l $1 2>/dev/null ;;
+ *.rpm) rpm -qilp "$1" 2>/dev/null ;;
+ *.[1-9] | *.n | *.man)
+ [ "$(file -L $1 | cut -d ' ' -f 2)" = "troff" -o \
+ "$(file -L $1 | cut -d ' ' -f 2)" = "ASCII" ] &&
+ groff -S -s -p -t -e -Tascii -mandoc "$1" 2>/dev/null ;;
+ *.[1-9].gz | *.n.gz | *.man.gz)
+ [ "$(gzip -dc $1 2>/dev/null|file -|tr -s ' '|cut -d ' ' -f3)" = "troff" -o \
+ "$(gzip -dc $1 2>/dev/null|file -|tr -s ' '|cut -d ' ' -f3)" = "ASCII" ] &&
+ gzip -dc $1 2>/dev/null | groff -S -s -p -t -e -Tascii -mandoc ;;
+ *.gz) gzip -dc $1 2>/dev/null ;; # keep this after the above statement :)
+ *) FILE="$(file -L $1)"
+ FILE1="$(echo $FILE | cut -d ' ' -f 2)"
+ FILE2="$(echo $FILE | cut -d ' ' -f 3)"
+ [ "$FILE1" = "Linux/i386" -o "$FILE2" = "Linux/i386" -o \
+ "$FILE1" = "ELF" -o "$FILE2" = "ELF" ] && strings $1 ;;
+
+ esac
+}
+
+lesspipe $1
diff --git a/sys-apps/less/less-371.ebuild b/sys-apps/less/less-371-r1.ebuild
index f4efec5b1371..949665f82a96 100644
--- a/sys-apps/less/less-371.ebuild
+++ b/sys-apps/less/less-371-r1.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Maintainer: Daniel Robbins <drobbins@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/less/less-371.ebuild,v 1.1 2002/01/03 16:09:34 drobbins Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/less/less-371-r1.ebuild,v 1.1 2002/01/07 04:05:30 drobbins Exp $
DESCRIPTION="Excellent text file viewer"
HOMEPAGE="http://www.greenwoodsoftware.com"
@@ -17,7 +17,7 @@ src_compile() {
src_install() {
dobin less lessecho lesskey
- exeinto /usr/bin ; doexe ${FILESDIR}/lesspipe.sh
+ exeinto /usr/bin ; newexe ${FILESDIR}/lesspipe.sh-r1 lesspipe.sh
dodoc COPYING NEWS README LICENSE
newman lesskey.nro lesskey.1
newman less.nro less.1