# ChangeLog for sys-apps/less
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/less/ChangeLog,v 1.43 2005/09/17 00:30:23 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/less/ChangeLog,v 1.44 2005/10/16 21:46:13 vapier Exp $
+
+*less-385_p4-r2 (16 Oct 2005)
+
+ 16 Oct 2005; Mike Frysinger <vapier@gentoo.org> files/lesspipe.sh,
+ +less-385_p4-r2.ebuild:
+ Tweak the manpage case in lesspipe.sh to display compressed text files which
+ are named funny #109419.
17 Sep 2005; Ciaran McCreesh <ciaranm@gentoo.org> ChangeLog:
Converted to UTF-8, fixed encoding screwups
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-MD5 adb0b1124c355f33197454d2be87bfd3 less-382-r2.ebuild 791
-MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
-MD5 af98f836f9e4cd4e5cec2c0889737743 less-385_p4.ebuild 1155
-MD5 147e4c10285042fad83d0c3592498e8c less-385.ebuild 800
-MD5 67f7e4bb3c37bfec9054a88133b26510 less-385_p4-r1.ebuild 1326
-MD5 969d74d1929613ded842c599bd731429 ChangeLog 5697
+MD5 3ea6992005facd6b91efc55c14699d8a ChangeLog 5929
+MD5 0f015b2ac33a3d039f77c6f15b768895 files/code2color.patch 221
MD5 6f05cb473c8bd03fb8fb5ba7466aa804 files/digest-less-382-r2 60
-MD5 f5d6d65946fd9d3091b3d06bc3615492 files/digest-less-385_p4-r1 181
-MD5 3fff08ad32f719677741c6a31c3ddd5f files/lesspipe.sh 3951
MD5 c9bb99cd4f916916f975c59d38c3d590 files/digest-less-385 60
-MD5 0f015b2ac33a3d039f77c6f15b768895 files/code2color.patch 221
MD5 07e2862dc300b691cba6dfb12426b732 files/digest-less-385_p4 126
+MD5 f5d6d65946fd9d3091b3d06bc3615492 files/digest-less-385_p4-r1 181
+MD5 f5d6d65946fd9d3091b3d06bc3615492 files/digest-less-385_p4-r2 181
+MD5 53ecababa7182cd2a3dac9e75f3a3a21 files/lesspipe.sh 4037
+MD5 adb0b1124c355f33197454d2be87bfd3 less-382-r2.ebuild 791
+MD5 147e4c10285042fad83d0c3592498e8c less-385.ebuild 800
+MD5 67f7e4bb3c37bfec9054a88133b26510 less-385_p4-r1.ebuild 1326
+MD5 1ba3193c2380031453f762b89aa86388 less-385_p4-r2.ebuild 1326
+MD5 af98f836f9e4cd4e5cec2c0889737743 less-385_p4.ebuild 1155
+MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
-iD8DBQFDQa6vgIKl8Uu19MoRAgjVAJ993M1nAHzOutKvrVlSgdF8GLzzVQCeNvRC
-lKN9o66Ple4waCMhu9oL610=
-=969u
+iD8DBQFDUsq2gIKl8Uu19MoRAg70AJ9JS6lGNivjesVd3XcpZHkAnDFDawCeIxs6
+LO0Py+UNKmf3RDUOymOsi8w=
+=XYj4
-----END PGP SIGNATURE-----
--- /dev/null
+MD5 2856987228fb140f95d60e311ef3d931 less-385.tar.gz 269752
+MD5 ea0d9670c1e293e2bb752f36f877e43f less-385-cl4.patch.bz2 24444
+MD5 da9d228944dae497d3b92f236bcf7226 code2color 199875
# Preprocessor for 'less'. Used when this environment variable is set:
# LESSOPEN="|lesspipe.sh %s"
+# TODO: handle compressed files better
+
trap 'exit 0' PIPE
guesscompress() {
*" Zip archive"*) lesspipe "$1" ".zip" ;;
*" ELF "*) readelf -a -- "$1" ;;
*": data") hexdump -C -- "$1" ;;
+ *) return 1 ;;
esac
+ return 0
}
lesspipe() {
- local DECOMPRESSOR=""
local match=$2
[[ -z ${match} ]] && match=$1
+ local DECOMPRESSOR=$(guesscompress "$match")
+
case "$match" in
### Doc files ###
*.[0-9n]|*.man|\
*.[0-9n].bz2|*.man.bz2|\
- *.[0-9n].gz|*.man.gz)
- DECOMPRESSOR=$(guesscompress "$match")
- if [[ $($DECOMPRESSOR -- "$1" | file -) == *troff* ]] ; then
- # Need to make sure we pass path to man or it will try
- # to locate "$1" in the man search paths
- if [[ $1 == /* ]] ; then
- man -- "$1"
- else
- man -- "./$1"
- fi
- else
- # We could have matched a library (libc.so.6), so let
- # `file` figure out what the hell this thing is
- case "$match" in
- *.man.gz|*.man.bz2) $DECOMPRESSOR -- "$1";;
- *) lesspipe_file "$1";;
- esac
- fi
+ *.[0-9n].gz|*.man.gz|\
+ *.[0-9][a-z].gz|*.[0-9][a-z].gz)
+ local out=$(${DECOMPRESSOR} -- "$1" | file -)
+ case ${out} in
+ *troff*)
+ # Need to make sure we pass path to man or it will try
+ # to locate "$1" in the man search paths
+ if [[ $1 == /* ]] ; then
+ man -- "$1"
+ else
+ man -- "./$1"
+ fi
+ ;;
+ *text*)
+ ${DECOMPRESSOR} -- "$1"
+ ;;
+ *)
+ # We could have matched a library (libc.so.6), so let
+ # `file` figure out what the hell this thing is
+ lesspipe_file "$1"
+ ;;
+ esac
;;
*.dvi) dvi2tty "$1" ;;
*.ps|*.pdf) ps2ascii "$1" || pstotext "$1" || pdftotext "$1" ;;
--- /dev/null
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/less/less-385_p4-r2.ebuild,v 1.1 2005/10/16 21:46:13 vapier Exp $
+
+inherit eutils
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PATCH_VER=${PV/_p/-cl}
+DESCRIPTION="Excellent text file viewer"
+HOMEPAGE="http://www.greenwoodsoftware.com/less/ https://gna.org/forum/forum.php?forum_id=715"
+SRC_URI="http://www.greenwoodsoftware.com/less/${MY_P}.tar.gz
+ http://download.gna.org/hpr/less/${MY_PV}/${PATCH_VER}/less-${PATCH_VER}.patch.bz2
+ http://www-zeuthen.desy.de/~friebel/unix/less/code2color"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+DEPEND=">=sys-libs/ncurses-5.2"
+PROVIDE="virtual/pager"
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+ cd "${S}"
+ epatch "${DISTDIR}"/less-${PATCH_VER}.patch.bz2
+ cp "${DISTDIR}"/code2color "${S}"/
+ epatch "${FILESDIR}"/code2color.patch
+}
+
+src_install() {
+ dobin less lessecho lesskey code2color || die "dobin"
+ newbin "${FILESDIR}"/lesspipe.sh lesspipe.sh || die "newbin"
+
+ # the -R is Needed for groff-1.18 and later ...
+ echo 'LESS="-R -M --shift 5"' > 70less
+ doenvd 70less
+
+ for m in *.nro ; do
+ newman ${m} ${m/nro/1}
+ done
+
+ dodoc NEWS README*
+}