Prefer gpg2 over gpg for *.gpg

Resolves: rhbz#1383284
Version: 481-6
This commit is contained in:
Ville Skyttä 2016-10-11 10:13:42 +03:00 committed by Pavel Raiskup
parent 8e7f15f2e1
commit 6502b093ba
2 changed files with 16 additions and 2 deletions

View File

@ -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ä <ville.skytta@iki.fi> - 481-6
- Prefer gpg2 over gpg for *.gpg (rhbz#1383284)
* Mon Apr 25 2016 Pavel Raiskup <praiskup@redhat.com> - 481-5
- again use the correct '||' syntax in LESSOPEN variable (rhbz#1254837)

View File

@ -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"