diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-09-25 19:33:39 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-09-28 08:31:11 +0100 |
commit | ad6182343997a405079870a2fe91c4e0c6b94595 (patch) | |
tree | 4aa7483cd0ad7de54338afc8e7971417abe1dd81 /sys-apps/less | |
parent | e8f81810baa21f490d6910e8e2d424546b72a333 (diff) |
gentoo resync : 25.09.2019
Diffstat (limited to 'sys-apps/less')
-rw-r--r-- | sys-apps/less/Manifest | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | sys-apps/less/files/lesspipe.sh | 29 |
2 files changed, 17 insertions, 14 deletions
diff --git a/sys-apps/less/Manifest b/sys-apps/less/Manifest index 37c7cadfef12..f28c456633be 100644 --- a/sys-apps/less/Manifest +++ b/sys-apps/less/Manifest @@ -1,5 +1,5 @@ AUX less.envd 47 BLAKE2B 4ebc9242c96918c6942b05f67a9be541c6c535c23072e89e36c376e690cb7df9528e1734514092a6afdd3d4f47db45c6186a8cce5d9eb18ca7c73a01800f35fc SHA512 261b25887b08b3255e412b36130d014fc37ffc7de75dce3b5ba2521d94a1b0be4c584808b9698c30a8dafea70c62fae2cd0642d0983f96cdb418c3c501433674 -AUX lesspipe.sh 7797 BLAKE2B 1f66e2ef843e24de958dab1577f6f69f63b260369b9b625c1fd823a8f5a00a110df3492d299b04a66b003528549991c0b87e1ee80835a0383667991b6a8bba50 SHA512 d7bbae07e8ddcae2981549f958daffc3750f3a343da37cd5e43df86b4dcab35c3121d7fa7b76d61dd457c972a888bcce1c85d01fa1e685aadf169d5541bb0d8b +AUX lesspipe.sh 8044 BLAKE2B 9ea7f314c852dee57f9745ee04f4d0779c2e22a138ee9ef479199cc5838cc5edfb08a1a1408ce12f1cf668e4b563abba24fa4ea2ea4abaa1c85a2d3cc3ed608a SHA512 e8b406127f3af3a4c3f9f37c4f165e334311a8da251c5a686b6bfbc24c2cbb202f27aaca5c7b426cc29036b48d944e6be5cbec2839e6e2712aaeb16c5d4522e6 DIST less-530.tar.gz 339723 BLAKE2B 9321548b06330c0b1b5b5a36147f5b9348619ff15d907808744b89581edeb4d8c2118ba455d024a23850902cac4d2c34d1e7b9897e02769584315c0e67ef667e SHA512 8d83a18b5648c4fe85921a563aa2c40bcf495aeb611098c83cd167b1e2f706649846cdf457c8506ae2683ab362ad970a0b261747349673020894bccdb9acbc10 DIST less-531.tar.gz 340466 BLAKE2B 6ac75b623fce478114d18cff429659499fedf4ef1a7bb067465ace91c28a7968efb224a4994a1e376a8cf40b110492f10ecda634628029107b38187044a0cd1e SHA512 180b665f194d7cc40d4bbb37bd64b10be463c0705e81795bef84b20dbba1c61825bb3e3da8bcd79f9176bb3af7b1f4e4c3dfe0829a5a2195a11f5b42294daca1 DIST less-550.tar.gz 347026 BLAKE2B b033cb09d1bb9624c56db14084c73e5154e36cebd3f757dd2cb1b012b8797e7647d152bb67ce4ea9c2d188b1252fd7ddfd8a113656af5ec9a1e688145d4d9265 SHA512 a3d2769d90589a8e6afbfc9ac10cd1b544e0b0bbe28884e5ad980a71c541a37545c11d3450984b346b516fe082dfc0cf89d246c5a2d6002a7a2b4a4296a15494 diff --git a/sys-apps/less/files/lesspipe.sh b/sys-apps/less/files/lesspipe.sh index 66078850cbda..68ec0f67926d 100755..100644 --- a/sys-apps/less/files/lesspipe.sh +++ b/sys-apps/less/files/lesspipe.sh @@ -1,11 +1,13 @@ #!/bin/bash -# +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + # Preprocessor for 'less'. Used when this environment variable is set: # LESSOPEN="|lesspipe %s" # TODO: handle compressed files better -[[ -n ${LESSDEBUG} ]] && set -x +[[ -n ${LESSDEBUG+set} ]] && set -x trap 'exit 0' PIPE @@ -64,8 +66,9 @@ lesspipe() { ls -alF -- "$1" return elif [[ ! -f $1 ]] ; then - stat "$1" - return + # Only return if the stat passes. This is needed to handle pseudo + # arguments like URIs. + stat -- "$1" && return fi case "${match}" in @@ -104,10 +107,11 @@ lesspipe() { *.doc) antiword "$1" || catdoc "$1" ;; *.rtf) unrtf --nopict --text "$1" ;; *.conf|*.txt|*.log) ;; # force less to work on these directly #150256 + *.json) python -mjson.tool "$1" ;; ### URLs ### - ftp://*|http://*|*.htm|*.html) - for b in links2 links lynx ; do + ftp://*|http://*|https://|*.htm|*.html) + for b in elinks links2 links lynx ; do ${b} -dump "$1" && exit 0 done html2text -style pretty "$1" @@ -120,7 +124,7 @@ lesspipe() { *.tar.lzma|*.tar.xz) ${DECOMPRESSOR} -- "$1" | tar tvvf -;; *.tbz2|*.tbz|*.tgz|*.tlz|*.txz) - lesspipe "$1" "$1".tar.${1##*.t} ;; + lesspipe "$1" "$1.tar.${1##*.t}" ;; ### Misc archives ### *.bz2|\ @@ -207,7 +211,7 @@ lesspipe() { *) case $(( recur++ )) in # Maybe we didn't match due to case issues ... - 0) lesspipe "$1" "$(echo $1 | LC_ALL=C tr '[:upper:]' '[:lower:]')" ;; + 0) lesspipe "$1" "$(echo "$1" | LC_ALL=C tr '[:upper:]' '[:lower:]')" ;; # Maybe we didn't match because the file is named weird ... 1) lesspipe_file "$1" ;; @@ -241,12 +245,12 @@ lesspipe() { esac } -if [[ -z $1 ]] ; then +if [[ $# -eq 0 ]] ; then echo "Usage: lesspipe <file>" elif [[ $1 == "-V" || $1 == "--version" ]] ; then cat <<-EOF lesspipe (git) - Copyright 2001-2016 Gentoo Foundation + Copyright 1999-2019 Gentoo Authors Mike Frysinger <vapier@gentoo.org> (with plenty of ideas stolen from other projects/distros) @@ -275,7 +279,6 @@ elif [[ $1 == "-h" || $1 == "--help" ]] ; then EOF else recur=0 - [[ -n ${LESSDEBUG} ]] \ - && lesspipe "$1" \ - || lesspipe "$1" 2> /dev/null + [[ -z ${LESSDEBUG+set} ]] && exec 2>/dev/null + lesspipe "$1" fi |