summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/less')
-rw-r--r--sys-apps/less/Manifest1
-rw-r--r--sys-apps/less/files/code2color-0.2.patch26
-rw-r--r--sys-apps/less/files/lesspipe.sh27
-rw-r--r--sys-apps/less/less-483-r1.ebuild (renamed from sys-apps/less/less-483.ebuild)35
-rw-r--r--sys-apps/less/metadata.xml2
5 files changed, 27 insertions, 64 deletions
diff --git a/sys-apps/less/Manifest b/sys-apps/less/Manifest
index f2e3a449..0f090058 100644
--- a/sys-apps/less/Manifest
+++ b/sys-apps/less/Manifest
@@ -1,3 +1,2 @@
-DIST code2color-0.2 200711 SHA256 2365c9009b1cc3c30430b88775ec402164df105fd12364871d05dcaed20be954
DIST less-483.tar.gz 316897 SHA256 7ebb1a0a141a94f863c0b83eff94fb115d716802fabe8007e442adbaf81ce41f
DIST less-select-2.6.tar.gz 26354 SHA256 df4ab8f17568cabd864358e5f0a765241f586b8c30341116a649db91db9048bf
diff --git a/sys-apps/less/files/code2color-0.2.patch b/sys-apps/less/files/code2color-0.2.patch
deleted file mode 100644
index f8a78250..00000000
--- a/sys-apps/less/files/code2color-0.2.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- code2color
-+++ code2color
-@@ -163,11 +163,11 @@
- # building up the database
- # newer entries overwrite old ones
- my @CONFIG_FILES;
-- push @CONFIG_FILES, "/etc/code2html.config";
-+ push @CONFIG_FILES, "/etc/code2color";
- push @CONFIG_FILES,
-- $ENV{'HOME'}."/.code2html.config" if $ENV{'HOME'};
-+ $ENV{'HOME'}."/.code2color" if $ENV{'HOME'};
- push @CONFIG_FILES,
-- split(/:/,$ENV{'CODE2HTML_CONFIG'}) if $ENV{'CODE2HTML_CONFIG'};
-+ split(/:/,$ENV{'CODE2COLOR_CONFIG'}) if $ENV{'CODE2COLOR_CONFIG'};
- push @CONFIG_FILES,
- split(/:/,$params{'langfile'}) if $params{'langfile'};
-
-@@ -3192,7 +3192,7 @@
- #
-
- $LANGUAGE{'shellscript'} = {
-- 'filename' => '\\.(sh|shell)$',
-+ 'filename' => '\\.(ebuild|eclass|sh|shell)$',
- 'regex' => '^\\s*#\\s*![^\\s]*(sh|bash|ash|zsh|ksh)',
- 'patterns' => [ {
- 'name' => 'comment',
diff --git a/sys-apps/less/files/lesspipe.sh b/sys-apps/less/files/lesspipe.sh
index 6edaa3ce..291d6d66 100644
--- a/sys-apps/less/files/lesspipe.sh
+++ b/sys-apps/less/files/lesspipe.sh
@@ -59,6 +59,15 @@ lesspipe() {
[[ ${match} == *.${ignore} ]] && exit 0
done
+ # Handle non-regular file types.
+ if [[ -d $1 ]] ; then
+ ls -alF -- "$1"
+ return
+ elif [[ ! -f $1 ]] ; then
+ stat "$1"
+ return
+ fi
+
case "${match}" in
### Doc files ###
@@ -90,7 +99,8 @@ lesspipe() {
esac
;;
*.dvi) dvi2tty "$1" ;;
- *.ps|*.pdf) ps2ascii "$1" || pstotext "$1" || pdftotext "$1" ;;
+ *.ps) ps2ascii "$1" || pstotext "$1" ;;
+ *.pdf) pdftotext "$1" - || ps2ascii "$1" || pstotext "$1" ;;
*.doc) antiword "$1" || catdoc "$1" ;;
*.rtf) unrtf --nopict --text "$1" ;;
*.conf|*.txt|*.log) ;; # force less to work on these directly #150256
@@ -234,14 +244,12 @@ lesspipe() {
if [[ -z $1 ]] ; then
echo "Usage: lesspipe <file>"
elif [[ $1 == "-V" || $1 == "--version" ]] ; then
- Id="cvsid"
cat <<-EOF
- $Id$
- Copyright 2001-2013 Gentoo Foundation
+ lesspipe (git)
+ Copyright 2001-2016 Gentoo Foundation
Mike Frysinger <vapier@gentoo.org>
(with plenty of ideas stolen from other projects/distros)
-
EOF
less -V
elif [[ $1 == "-h" || $1 == "--help" ]] ; then
@@ -251,21 +259,20 @@ elif [[ $1 == "-h" || $1 == "--help" ]] ; then
Usage: lesspipe <file>
lesspipe specific settings:
- LESSCOLOR env - toggle colorizing of output (no/yes/always)
+ LESSCOLOR env - toggle colorizing of output (no/yes/always; default: no)
LESSCOLORIZER env - program used to colorize output (default: code2color)
LESSIGNORE - list of extensions to ignore (don't do anything fancy)
You can create per-user filters as well by creating the executable file:
~/.lessfilter
- One argument is passed to it: the file to display.
+ One argument is passed to it: the file to display. The script should exit 0
+ to indicate it handled the file, or non-zero to tell lesspipe to handle it.
To use lesspipe, simply add to your environment:
export LESSOPEN="|lesspipe %s"
- Run 'less --help' or 'man less' for more info
+ Run 'less --help' or 'man less' for more info.
EOF
-elif [[ -d $1 ]] ; then
- ls -alF -- "$1"
else
recur=0
[[ -n ${LESSDEBUG} ]] \
diff --git a/sys-apps/less/less-483.ebuild b/sys-apps/less/less-483-r1.ebuild
index 6ce6c2bc..11b232c2 100644
--- a/sys-apps/less/less-483.ebuild
+++ b/sys-apps/less/less-483-r1.ebuild
@@ -4,8 +4,6 @@
EAPI=6
-CODE2COLOR_PV="0.2"
-CODE2COLOR_P="code2color-${CODE2COLOR_PV}"
DESCRIPTION="Excellent text file viewer, optionally with additional selection feature"
PATCHN="less-select"
PATCHV="2.6"
@@ -15,8 +13,7 @@ PATCHBALL="${PATCHRUMP}.tar.gz"
SELECTDIR="${WORKDIR}/${PATCHRUMP}"
HOMEPAGE="http://www.greenwoodsoftware.com/less/ https://github.com/vaeth/${PATCHN}"
SRC_URI="http://www.greenwoodsoftware.com/less/${P}.tar.gz
- less-select? ( https://github.com/vaeth/${PATCHN}/archive/v${PATCHV}.tar.gz -> ${PATCHBALL} )
- http://www-zeuthen.desy.de/~friebel/unix/less/code2color -> ${CODE2COLOR_P}"
+ less-select? ( https://github.com/vaeth/${PATCHN}/archive/v${PATCHV}.tar.gz -> ${PATCHBALL} )"
LICENSE="|| ( GPL-3 BSD-2 )"
SLOT="0"
@@ -29,7 +26,7 @@ DEPEND=">=app-misc/editor-wrapper-3
RDEPEND="${DEPEND}
less-select? ( dev-lang/perl )"
# || ( >=dev-lang/perl-5.10.1 >=virtual/perl-File-Temp-0.19 )
-PDEPEND="lesspipe? ( sys-apps/lesspipe )"
+PDEPEND="lesspipe? ( app-text/lesspipe )"
pkg_setup() {
if use source && ! use less-select
@@ -37,14 +34,6 @@ pkg_setup() {
fi
}
-src_unpack() {
- unpack ${P}.tar.gz
- cp "${DISTDIR}/${CODE2COLOR_P}" "${S}"/code2color || die
- if use less-select
- then unpack ${PATCHBALL}
- fi
-}
-
src_prepare() {
if use less-select
then eapply "${SELECTDIR}/patches/less-${PATCHVER}-select.patch"
@@ -52,7 +41,6 @@ src_prepare() {
sed -i -e 's|\([^a-zA-Z]\)/etc/less-select-key.bin|\1'"${EPREFIX}"'/etc/less/select-key.bin|g' \
"${SELECTDIR}/bin/less-select" || die
fi
- eapply -p0 "${FILESDIR}/${CODE2COLOR_P}.patch"
chmod a+x configure || die
eapply_user
}
@@ -74,19 +62,19 @@ src_compile() {
}
src_install() {
- local a
+ local a b
default
- if ! use lesspipe
- then dobin code2color
- newbin "${FILESDIR}"/lesspipe.sh lesspipe
- dosym lesspipe /usr/bin/lesspipe.sh
- fi
+ newbin "${FILESDIR}"/lesspipe.sh lesspipe
+
if use original-gentoo
then a="-R -M --shift 5"
else a="-sFRiMX --shift 5"
fi
- printf '%s\n' 'LESSOPEN="|lesspipe.sh %s"' "LESS=\"${a}\"" >70less
+ printf '%s\n' \
+ 'LESSOPEN="|lesspipe'$(! use lesspipe || echo .sh)'%s"' \
+ "LESS=\"${a}\"" \
+ >70less || die
doenvd 70less
dodoc "${FILESDIR}"/README.Gentoo
@@ -102,8 +90,3 @@ src_install() {
fi
fi
}
-
-pkg_postinst() {
- use lesspipe || \
- elog "lesspipe offers colorization options. Run 'lesspipe -h' for info."
-}
diff --git a/sys-apps/less/metadata.xml b/sys-apps/less/metadata.xml
index d56b6e96..812305c4 100644
--- a/sys-apps/less/metadata.xml
+++ b/sys-apps/less/metadata.xml
@@ -21,7 +21,7 @@
</upstream>
<use>
<flag name="original-gentoo">Use the gentoo default for the LESS variable.</flag>
- <flag name="lesspipe">Use sys-apps/lesspipe instead of Gentoo's default lesspipe.sh.</flag>
+ <flag name="lesspipe">Default to lesspipe.sh from app-text/lesspipe instead of the gentoo specific lesspipe.</flag>
<flag name="less-select">Add the less-select feature (additional options and a binary helper).</flag>
<flag name="source">Install sources for keybindings (only useful with less-select).</flag>
</use>