diff options
author | 2023-06-24 10:47:40 +0200 | |
---|---|---|
committer | 2023-06-24 10:47:40 +0200 | |
commit | 01e4cba9a9aa27badc903a60847717992df9dc7e (patch) | |
tree | d1e4d4b79ecc8af005d158e409bcadfb698e8b2e | |
parent | app-admin/sudox: Version bump (diff) | |
download | mv-01e4cba9a9aa27badc903a60847717992df9dc7e.tar.gz mv-01e4cba9a9aa27badc903a60847717992df9dc7e.tar.bz2 mv-01e4cba9a9aa27badc903a60847717992df9dc7e.zip |
sys-apps/less: revision bump
Signed-off-by: Martin Väth <martin@mvath.de>
-rw-r--r-- | metadata/pkg_desc_index | 2 | ||||
-rw-r--r-- | sys-apps/less/files/lesspipe-r2.sh (renamed from sys-apps/less/files/lesspipe-r1.sh) | 10 | ||||
-rw-r--r-- | sys-apps/less/less-633-r1.ebuild (renamed from sys-apps/less/less-633.ebuild) | 17 |
3 files changed, 22 insertions, 7 deletions
diff --git a/metadata/pkg_desc_index b/metadata/pkg_desc_index index d59617ed..681c639c 100644 --- a/metadata/pkg_desc_index +++ b/metadata/pkg_desc_index @@ -98,7 +98,7 @@ net-print/foo2zjs 20200221: Support for printing to ZjStream-based printers sci-geosciences/googleearth 7.1.8.3036-r4 7.3.0.3832-r4 7.3.4-r2: A 3D interface to the planet sci-mathematics/reduce 20141130-r3 20190413: A general-purpose computer algebra system sys-apps/cpi 3.2: A wrapper for cp -i -a, making use of diff -sys-apps/less 633: Excellent text file viewer, optionally with additional selection feature +sys-apps/less 633-r1: Excellent text file viewer, optionally with additional selection feature sys-apps/man 1.6g-r4: Standard commands to read man pages sys-apps/openrc-wrapper 2.4: Use openrc init scripts with systemd or other init systems sys-apps/paxopen 1.2: A wrapper script to set PAX kernel variables to an insecure/safe state diff --git a/sys-apps/less/files/lesspipe-r1.sh b/sys-apps/less/files/lesspipe-r2.sh index 9dcfea1d..fc54d5b2 100644 --- a/sys-apps/less/files/lesspipe-r1.sh +++ b/sys-apps/less/files/lesspipe-r2.sh @@ -231,9 +231,9 @@ lesspipe() { 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 + *) LESSCOLOR=1;; esac - if [[ ${LESSCOLOR} != "0" ]] && [[ -n ${LESSCOLORIZER=code2color} ]] ; then + if [[ ${LESSCOLOR} != "0" ]] && [[ -n ${LESSCOLORIZER=pygmentize} ]] ; 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 @@ -267,7 +267,7 @@ elif [[ $1 == "-h" || $1 == "--help" ]] ; then lesspipe specific settings: LESSCOLOR env - toggle colorizing of output (no/yes/always; default: no) - LESSCOLORIZER env - program used to colorize output (default: code2color) + LESSCOLORIZER env - program used to colorize output (default: pygmentize) LESSIGNORE - list of extensions to ignore (don't do anything fancy) You can create per-user filters as well by creating the executable file: @@ -278,6 +278,10 @@ elif [[ $1 == "-h" || $1 == "--help" ]] ; then To use lesspipe, simply add to your environment: export LESSOPEN="|lesspipe %s" + For colorization, install dev-python/pygments for the pygmentize program. Note, + if using alternative code2color from sys app-text/lesspipe you may run out of + memory due to #188835. + Run 'less --help' or 'man less' for more info. EOF else diff --git a/sys-apps/less/less-633.ebuild b/sys-apps/less/less-633-r1.ebuild index 96999db1..6fe90b67 100644 --- a/sys-apps/less/less-633.ebuild +++ b/sys-apps/less/less-633-r1.ebuild @@ -5,7 +5,7 @@ EAPI=8 WANT_AUTOMAKE=none WANT_LIBTOOL=none -inherit autotools +inherit autotools optfeature DESCRIPTION="Excellent text file viewer, optionally with additional selection feature" PATCHN="less-select" @@ -23,6 +23,9 @@ LICENSE="|| ( GPL-3 BSD-2 )" SLOT="0" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" IUSE="+lesspipe +less-select pcre original-gentoo source" +# As of 623_beta, lesstest is not included in dist tarballs +# https://github.com/gwsw/less/issues/344 +RESTRICT="test" DEPEND=" >=app-misc/editor-wrapper-3 @@ -70,18 +73,22 @@ src_compile() { fi } +src_test() { + emake check VERBOSE=1 +} + src_install() { local a default - newbin "${FILESDIR}"/lesspipe-r1.sh lesspipe + newbin "${FILESDIR}"/lesspipe-r2.sh lesspipe if use original-gentoo then a="-R -M --shift 5" else a="-sFRiMX --shift 5" fi printf '%s\n' \ - 'LESSOPEN="|lesspipe'$(! use lesspipe || echo .sh)' %s"' \ + 'LESSOPEN="|lesspipe'$(usex lesspipe .sh)' %s"' \ "LESS=\"${a}\"" \ >70less || die doenvd 70less @@ -97,3 +104,7 @@ src_install() { fi fi } + +pkg_preinst() { + use lesspipe || optfeature "Colorized output support" dev-python/pygments +} |