import which-2.21-16.el8

This commit is contained in:
CentOS Sources 2021-05-14 04:18:05 +00:00 committed by Andrew Lukoshko
parent 545bf93e25
commit 6e9cfbd57f
2 changed files with 17 additions and 9 deletions

View File

@ -1,18 +1,19 @@
# shellcheck shell=sh
# Initialization script for bash, sh, mksh and ksh
_declare="declare -f"
_opt="-f"
_shell="$(basename $SHELL)"
which_declare="declare -f"
which_opt="-f"
which_shell="$(cat /proc/$$/comm)"
if [ "$_shell" = "ksh" ] || [ "$_shell" = "mksh" ] || [ "$_shell" = "zsh" ] ; then
_declare="typeset -f"
_opt=""
if [ "$which_shell" = "ksh" ] || [ "$which_shell" = "mksh" ] || [ "$which_shell" = "zsh" ] ; then
which_declare="typeset -f"
which_opt=""
fi
which ()
{
(alias; eval ${_declare}) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot "$@"
(alias; eval ${which_declare}) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot "$@"
}
export ${_opt} which
export which_declare
export ${which_opt} which

View File

@ -1,7 +1,7 @@
Summary: Displays where a particular program in your path is located
Name: which
Version: 2.21
Release: 14%{?dist}
Release: 16%{?dist}
License: GPLv3
Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz
Source1: which2.sh
@ -41,6 +41,13 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
%{_mandir}/man1/which.1*
%changelog
* Wed May 05 2021 Than Ngo <than@redhat.com> - 2.21-16
- Related: #1940468, fixed unbound variable
* Fri Apr 30 2021 Than Ngo <than@redhat.com> - 2.21-15
- Related: #1940468, fix error when the user runs which in bash with strict bash environment
* Tue Mar 23 2021 Than Ngo <than@redhat.com> - 2.21-14
- Related: #1940468, fix regression if SHELL=zsh