From 6502b093ba9459375ebc463a7d256fa9e6718d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 11 Oct 2016 10:13:42 +0300 Subject: [PATCH] Prefer gpg2 over gpg for *.gpg Resolves: rhbz#1383284 Version: 481-6 --- less.spec | 5 ++++- lesspipe.sh | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/less.spec b/less.spec index d7dddf8..afc67be 100644 --- a/less.spec +++ b/less.spec @@ -1,7 +1,7 @@ Summary: A text file browser similar to more, but better Name: less Version: 481 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ or BSD Group: Applications/Text Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz @@ -65,6 +65,9 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d %{_mandir}/man1/* %changelog +* Tue Oct 11 2016 Ville Skyttä - 481-6 +- Prefer gpg2 over gpg for *.gpg (rhbz#1383284) + * Mon Apr 25 2016 Pavel Raiskup - 481-5 - again use the correct '||' syntax in LESSOPEN variable (rhbz#1254837) diff --git a/lesspipe.sh b/lesspipe.sh index d61dc4c..017fe2d 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -76,7 +76,18 @@ case "$1" in *.zip|*.jar|*.nbm) zipinfo -- "$1"; exit $? ;; *.rpm) rpm -qpivl --changelog -- "$1"; exit $? ;; *.cpi|*.cpio) cpio -itv < "$1"; exit $? ;; -*.gpg) gpg -d "$1"; exit $? ;; +*.gpg) + if [ -x /usr/bin/gpg2 ]; then + gpg2 -d "$1" + exit $? + elif [ -x /usr/bin/gpg ]; then + gpg -d "$1" + exit $? + else + echo "No GnuPG available." + echo "Install gnupg2 or gnupg to show encrypted files." + exit 1 + fi ;; *.gif|*.jpeg|*.jpg|*.pcd|*.png|*.tga|*.tiff|*.tif) if [ -x /usr/bin/identify ]; then identify "$1"