summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2010-03-30 22:09:46 +0200
committerMartin Väth <martin@mvath.de>2015-10-11 10:45:19 +0200
commitfd7be396534a38d249079c21e8fce31fa8050fe8 (patch)
treec6b948b6e752e813c7e1a8ee52a3c5a4ae0ef8be /sys-apps
parentImport of the mv overlay (diff)
downloadmv-fd7be396534a38d249079c21e8fce31fa8050fe8.tar.gz
mv-fd7be396534a38d249079c21e8fce31fa8050fe8.tar.bz2
mv-fd7be396534a38d249079c21e8fce31fa8050fe8.zip
Update lesspipe.sh to latest version in portage tree
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/less-select/ChangeLog6
-rw-r--r--sys-apps/less-select/Manifest6
-rw-r--r--sys-apps/less-select/files/lesspipe.sh84
-rw-r--r--sys-apps/less-select/less-select-436-r1.ebuild (renamed from sys-apps/less-select/less-select-436.ebuild)12
4 files changed, 61 insertions, 47 deletions
diff --git a/sys-apps/less-select/ChangeLog b/sys-apps/less-select/ChangeLog
index 21cb19e1..64a357b9 100644
--- a/sys-apps/less-select/ChangeLog
+++ b/sys-apps/less-select/ChangeLog
@@ -2,6 +2,12 @@
# Distributed under the terms of the GNU General Public License v2
# $Header $
+*less-select-436-r1.ebuild (30 Mar 2010)
+
+ 30 Mar 2010; Martin Väth <martin@mvath.de> :
+ -less-select-436.ebuild +less-select-436-r1.ebuild files/lesspipe.sh:
+ Update lesspipe.sh and related changes of sys-apps/less in portage tree.
+
22 Jul 2009; Martin Väth <martin@mvath.de> :
Version bump to less-436
diff --git a/sys-apps/less-select/Manifest b/sys-apps/less-select/Manifest
index 52ce5525..9dceb045 100644
--- a/sys-apps/less-select/Manifest
+++ b/sys-apps/less-select/Manifest
@@ -1,10 +1,10 @@
AUX README.Gentoo 823 RMD160 be59c37906fca17fa25f6781d3f5e7abc114dc57 SHA1 5a1f126af728f5220b97623050e2f9b1ea5ae58e SHA256 3985fd1810f660ea1c1f2732f719b069b6934d62d8d9e8a09287e63f049ba27d
AUX code2color.patch 1110 RMD160 712f7b79c94f92ee62825d5f53627f18fae693d2 SHA1 a82f937f3a923b52adc4f14cfc9b641903884839 SHA256 a3887126826ef0b4b821bd97cf4e7abfc8b1c9280bf2bb18a2a4cec9a2973936
AUX less.envd 50 RMD160 e9d7b2497aa81e13b740dc765c0fc87d4f1f2f8e SHA1 f903d459e7f0b2c14009304bebb7a045a7cccf9d SHA256 1f186ac4f500c842a9016702b3d7e9d69fe161db23cf56c316ed7f5a51da6a4e
-AUX lesspipe.sh 6966 RMD160 0101ee8ceea57e5c31e1e38cf417e47bcc5f8a78 SHA1 8142b1755bd545be21b42eda0c966c8fb7d2ec0d SHA256 d3e2d7c7f97cd2ff6ccdadea20d1fc5591dbbd17ac7c6757249ecfc2c4ac68a4
+AUX lesspipe.sh 7180 RMD160 460d9b4bd9dd7bbeae05f0441dc47ad5b1f8437f SHA1 8e7baca8239b8b36649bb9d0bb4ab0642b3a3bb6 SHA256 57d0d2022223ac028c2ac65b50944127520c8c1a9129e8ee493746677592c23c
DIST code2color 199875 RMD160 378d340a20c3fe500f19116220d54816fe279225 SHA1 b30526dd52c747b8bd6dcf53cf5cc94824c47feb SHA256 ce63f148293a81b0fe5e072f33285f9bf4f1d832f64b23a2220519674a47091d
DIST less-436.tar.gz 303921 RMD160 b186b76fcdbf38056b32fbc1b54877dccf64a8ec SHA1 f78998a1a79a7e1962c901dd41bdc3d1c2005471 SHA256 57a16ff07431a9af45cf1cd5b374e1066d019304219f0d156e22bb8c4d6734d2
DIST less-select-patch-436.tar.gz 47383 RMD160 5ccbe853d1f6ce5940f283bd8265ce8b75e20363 SHA1 21f3f8b16be8cd0724820c167d6f685d236cec36 SHA256 bbdd0ee9241803b8de719c358090354bde63472d1df6db271a50be51bfc800f3
-EBUILD less-select-436.ebuild 2291 RMD160 e7145dd25beeeabfebf141f61dab90d0f066d2a2 SHA1 0bd3f839229c468a0e1670fac2d2916cd395a322 SHA256 e84ec916e7a47238de3ff00546ebced5551c72c561ea1b72502a16689471e42e
-MISC ChangeLog 1173 RMD160 e50821f7ba68924ac9efb539d0e1f3cd24f71d9e SHA1 f982dd0c85cc28953cd7a7cecd8c4d6642e39bbc SHA256 8bb38d02108a7267e88cc12aaa4b93410693258b8f0f3bab5154877dfcbcdcdc
+EBUILD less-select-436-r1.ebuild 2452 RMD160 9834d44e0766b14f6a8893af47ccc32821bcea51 SHA1 33e307323e914d3eefaa4b09fe5af3ae328beeb0 SHA256 b246728706a4004ca7cf15081e1f6c1f6aa41bdb2dc9cc13f381a1264e4b5bcc
+MISC ChangeLog 1429 RMD160 60b480b860d9391d7010b0c91604704a043d50e0 SHA1 14f5042d244670f39addc6b25dd986c1ef05c9ed SHA256 c700f7088cdf522d2fb0c6a74f1b00c6fca9e424e50d60eeb6085c746e66b14a
MISC metadata.xml 519 RMD160 0bddd9edd8deaf798fff7f50d3e6cdb00daff1b9 SHA1 4a5eb0f9ca4a380d0c9268e6d0e8ba4a54fbb256 SHA256 100c0d2dc9aacdc78d678da8b5ed7d0a36bd1fe5b7ea06345ded87afd9cda442
diff --git a/sys-apps/less-select/files/lesspipe.sh b/sys-apps/less-select/files/lesspipe.sh
index afa7dc99..b793acc1 100644
--- a/sys-apps/less-select/files/lesspipe.sh
+++ b/sys-apps/less-select/files/lesspipe.sh
@@ -5,16 +5,18 @@
# TODO: handle compressed files better
+[[ -n ${LESSDEBUG} ]] && set -x
+
trap 'exit 0' PIPE
guesscompress() {
case "$1" in
- *.gz|*.z) echo "gunzip -c" ;;
- *.bz2) echo "bunzip2 -c" ;;
- *.lz) echo "lzip -c" ;;
- *.lzma) echo "unlzma -c" ;;
- *.xz) echo "xzdec" ;;
- *) echo "cat" ;;
+ *.gz|*.z) echo "gunzip -c" ;;
+ *.bz2|*.bz) echo "bunzip2 -c" ;;
+ *.lz) echo "lzip -c" ;;
+ *.lzma) echo "unlzma -c" ;;
+ *.xz) echo "xzdec" ;;
+ *) echo "cat" ;;
esac
}
@@ -101,11 +103,12 @@ lesspipe() {
### Tar files ###
*.tar|\
- *.tar.bz2|*.tbz2|*.tbz|\
- *.tar.gz|*.tgz|*.tar.z|\
+ *.tar.bz2|*.tar.bz|*.tar.gz|*.tar.z|\
*.tar.lz|*.tar.tlz|\
*.tar.lzma|*.tar.xz)
${DECOMPRESSOR} -- "$1" | tar tvvf -;;
+ *.tbz2|*.tbz|*.tgz|*.tlz)
+ lesspipe "$1" "$1".tar.${1##*.t} ;;
### Misc archives ###
*.bz2|\
@@ -120,7 +123,7 @@ lesspipe() {
*.cab) cabextract -l -- "$1" ;;
*.lha|*.lzh) lha v "$1" ;;
*.zoo) zoo -list "$1" || unzoo -l "$1" ;;
- *.7z) 7z l -- "$1" || 7za l -- "$1" ;;
+ *.7z|*.exe) 7z l -- "$1" || 7za l -- "$1" ;;
*.a) ar tv "$1" ;;
*.elf) readelf -a -- "$1" ;;
*.so) readelf -h -d -s -- "$1" ;;
@@ -142,6 +145,9 @@ lesspipe() {
fi
;;
+ ### Filesystems ###
+ *.squashfs) unsquashfs -s "$1" && unsquashfs -ll "$1" ;;
+
### Media ###
*.bmp|*.gif|*.jpeg|*.jpg|*.ico|*.pcd|*.pcx|*.png|*.ppm|*.tga|*.tiff|*.tif)
identify "$1" || file -L -- "$1"
@@ -169,34 +175,6 @@ lesspipe() {
isoinfo -l ${iso_opts} -i "$1"
;;
- ### Source code ###
- *.awk|*.groff|*.java|*.js|*.m4|*.php|*.pl|*.pm|*.pod|*.sh|\
- *.ad[asb]|*.asm|*.inc|*.[ch]|*.[ch]pp|*.[ch]xx|*.cc|*.hh|\
- *.lsp|*.l|*.pas|*.p|*.xml|*.xps|*.xsl|*.axp|*.ppd|*.pov|\
- *.diff|*.patch|*.py|*.rb|*.sql|*.ebuild|*.eclass)
-
- # Allow people to flip color off if they dont want it
- case ${LESSCOLOR} in
- always) LESSCOLOR=2;;
- [yY][eE][sS]|1|true) LESSCOLOR=1;;
- [nN][oO]|0|false) LESSCOLOR=0;;
- *) LESSCOLOR=0;; # default to no color #188835
- esac
- [[ ${LESSCOLORIZER+set} != "set" ]] && LESSCOLORIZER=code2color
- if [[ ${LESSCOLOR} == "0" ]] || [[ -z ${LESSCOLORIZER} ]] ; then
- # let less itself handle these files
- exit 0
- fi
-
- # 2: Only colorize if user forces it ...
- # 1: ... or we know less will handle raw codes -- this will
- # not detect -seiRM, so set LESSCOLORIZER yourself
- if [[ ${LESSCOLOR} == "2" ]] || [[ " ${LESS} " == *" -"[rR]" "* ]] ; then
- ${LESSCOLORIZER} "$1"
- exit 0
- fi
- ;;
-
# May not be such a good idea :)
# ### Device nodes ###
# /dev/[hs]d[a-z]*)
@@ -220,6 +198,29 @@ lesspipe() {
lesspipe_file "$1"
fi
+ # So no matches from above ... finally fall back to an external
+ # coloring package. No matching here so we don't have to worry
+ # about keeping in sync with random packages. Any coloring tool
+ # you use should not output errors about unsupported files to
+ # stdout. If it does, it's your problem.
+
+ # Allow people to flip color off if they dont want it
+ case ${LESSCOLOR} in
+ always) LESSCOLOR=2;;
+ [yY][eE][sS]|[yY]|1|true) LESSCOLOR=1;;
+ [nN][oO]|[nN]|0|false) LESSCOLOR=0;;
+ *) LESSCOLOR=0;; # default to no color #188835
+ esac
+ if [[ ${LESSCOLOR} != "0" ]] && [[ -n ${LESSCOLORIZER=code2color} ]] ; then
+ # 2: Only colorize if user forces it ...
+ # 1: ... or we know less will handle raw codes -- this will
+ # not detect -seiRM, so set LESSCOLORIZER yourself
+ if [[ ${LESSCOLOR} == "2" ]] || [[ " ${LESS} " == *" -"[rR]" "* ]] ; then
+ ${LESSCOLORIZER} "$1"
+ fi
+ fi
+
+ # Nothing left to do but let less deal
exit 0
;;
esac
@@ -229,10 +230,9 @@ if [[ -z $1 ]] ; then
echo "Usage: lesspipe.sh <file>"
elif [[ $1 == "-V" || $1 == "--version" ]] ; then
Id="cvsid"
- cvsid="$Id: lesspipe.sh,v 1.35 2009/04/11 23:20:51 vapier Exp $"
cat <<-EOF
- $cvsid
- Copyright 2001-2009 Gentoo Foundation
+ $Id: lesspipe.sh,v 1.40 2010/03/23 20:54:13 vapier Exp $
+ Copyright 2001-2010 Gentoo Foundation
Mike Frysinger <vapier@gentoo.org>
(with plenty of ideas stolen from other projects/distros)
@@ -263,5 +263,7 @@ elif [[ -d $1 ]] ; then
ls -alF -- "$1"
else
recur=0
- lesspipe "$1" 2> /dev/null
+ [[ -n ${LESSDEBUG} ]] \
+ && lesspipe "$1" \
+ || lesspipe "$1" 2> /dev/null
fi
diff --git a/sys-apps/less-select/less-select-436.ebuild b/sys-apps/less-select/less-select-436-r1.ebuild
index fbdcd17d..76a8099f 100644
--- a/sys-apps/less-select/less-select-436.ebuild
+++ b/sys-apps/less-select/less-select-436-r1.ebuild
@@ -11,7 +11,7 @@ SRC_URI="http://www.greenwoodsoftware.com/less/less-${PV}.tar.gz
http://www-zeuthen.desy.de/~friebel/unix/less/code2color
http://www.mathematik.uni-wuerzburg.de/~vaeth/download/less-select-patch-${PATCHVER}.tar.gz"
-LICENSE="|| ( GPL-3 less )"
+LICENSE="|| ( GPL-3 BSD-2 )"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
IUSE="unicode dummy-less"
@@ -53,8 +53,10 @@ src_install() {
emake install DESTDIR="${D}" || die
dobin code2color || die "dobin"
- newbin "${FILESDIR}"/lesspipe.sh lesspipe.sh || die "newbin"
- echo 'LESS="-sFR -iMX --shift 5"' > 70less
+ newbin "${FILESDIR}"/lesspipe.sh lesspipe || die "newbin"
+ dosym lesspipe /usr/bin/lesspipe.sh
+ echo 'LESSOPEN="|lesspipe.sh %s"
+LESS="-sFR -iMX --shift 5"' > 70less
doenvd 70less
dodoc NEWS README* "${FILESDIR}"/README.Gentoo "${MYSUBDIR}"/README.less-select
@@ -67,3 +69,7 @@ src_install() {
newins "${MYSUBDIR}/less-normal-key.src" lesskey.src
newins "${MYSUBDIR}/less-select-key.src" less-select-key.src
}
+
+pkg_postinst() {
+ einfo "lesspipe offers colorization options. Run 'lesspipe.sh -h' for info."
+}