From 7128ddbd689c34c1fd4f7790a91b9be243f2d304 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 31 Jan 2018 15:55:28 +0100 Subject: [PATCH] fixed bz#1526500 - 'declare' not found under ksh --- which.spec | 6 ++++-- which2.sh | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/which.spec b/which.spec index 780fa43..e6dcdd0 100644 --- a/which.spec +++ b/which.spec @@ -1,14 +1,13 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.21 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3 Group: Applications/System Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh Source2: which2.csh Url: https://savannah.gnu.org/projects/which/ -Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: readline-devel Requires(preun): /sbin/install-info Requires(post): /sbin/install-info @@ -57,6 +56,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/*/* %changelog +* Wed Jan 31 2018 Than Ngo - 2.21-5 +- fixed bz#1526500 - 'declare' not found under ksh + * Thu Aug 03 2017 Fedora Release Engineering - 2.21-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild diff --git a/which2.sh b/which2.sh index fe1afc8..3f06746 100644 --- a/which2.sh +++ b/which2.sh @@ -1,3 +1,7 @@ # Initialization script for bash and sh -alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot' +if [ "$0" == ksh ] ; then + alias which='(alias; typeset -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot' +else + alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot' +fi