[less] Added gpg support to lesspipe.sh (#885122)

FridolĂ­n PokornĂ˝ fpokorny at fedoraproject.org
Thu Apr 11 13:54:17 UTC 2013


commit de1ff32b5aa9e498e8cf7b15ef9b4d962368827f
Author: Fridolin Pokorny <fpokorny at redhat.com>
Date:   Thu Apr 11 15:52:56 2013 +0200

    Added gpg support to lesspipe.sh (#885122)
    
    - Added ~/.lessfilter support (#885122)

 less.spec   |    6 +++++-
 lesspipe.sh |    9 +++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/less.spec b/less.spec
index 5f3458c..85010dc 100644
--- a/less.spec
+++ b/less.spec
@@ -1,7 +1,7 @@
 Summary: A text file browser similar to more, but better
 Name: less
 Version: 458
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv3+
 Group: Applications/Text
 Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz
@@ -66,6 +66,10 @@ ls -la $RPM_BUILD_ROOT/etc/profile.d
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Thu Apr 11 2013 Fridolin Pokorny <fpokorny at redhat.com> - 458-2
+- Added gpg support to lesspipe.sh (#885122)
+- Added ~/.lessfilter support (#885122)
+
 * Thu Apr 11 2013 Fridolin Pokorny <fpokorny at redhat.com> - 458-1
 - Update to 458
 
diff --git a/lesspipe.sh b/lesspipe.sh
index e03d667..ede84db 100755
--- a/lesspipe.sh
+++ b/lesspipe.sh
@@ -22,6 +22,14 @@ fi
 
 exec 2>/dev/null
 
+# Allow for user defined filters
+if [ -x ~/.lessfilter ]; then
+	~/.lessfilter "$1"
+	if [ $? -eq 0 ]; then
+		exit 0
+	fi
+fi
+
 case "$1" in
 *.[1-9n].bz2|*.[1-9]x.bz2|*.man.bz2|*.[1-9n].[gx]z|*.[1-9]x.[gx]z|*.man.[gx]z|*.[1-9n].lzma|*.[1-9]x.lzma|*.man.lzma)
 	case "$1" in
@@ -48,6 +56,7 @@ case "$1" in
 *.zip|*.jar|*.nbm) zipinfo -- "$1" ;;
 *.rpm) rpm -qpivl --changelog -- "$1" ;;
 *.cpi|*.cpio) cpio -itv < "$1" ;;
+*.gpg) gpg -d "$1" ;;
 *.gif|*.jpeg|*.jpg|*.pcd|*.png|*.tga|*.tiff|*.tif)
 	if [ -x /usr/bin/identify ]; then
 		identify "$1"


More information about the scm-commits mailing list