Related: #1940464, fixed unbound variable
This commit is contained in:
parent
46cb79812e
commit
375ccdedb7
@ -1,7 +1,7 @@
|
|||||||
Summary: Displays where a particular program in your path is located
|
Summary: Displays where a particular program in your path is located
|
||||||
Name: which
|
Name: which
|
||||||
Version: 2.21
|
Version: 2.21
|
||||||
Release: 25%{?dist}
|
Release: 26%{?dist}
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz
|
Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz
|
||||||
Source1: which2.sh
|
Source1: which2.sh
|
||||||
@ -40,6 +40,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
|||||||
%{_mandir}/man1/which.1*
|
%{_mandir}/man1/which.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri May 07 2021 Than Ngo <than@redhat.com> - 2.21-26
|
||||||
|
- Related: #1940464, fixed unbound variable
|
||||||
|
|
||||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.21-25
|
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.21-25
|
||||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||||
|
|
||||||
|
17
which2.sh
17
which2.sh
@ -1,18 +1,19 @@
|
|||||||
# shellcheck shell=sh
|
# shellcheck shell=sh
|
||||||
# Initialization script for bash, sh, mksh and ksh
|
# Initialization script for bash, sh, mksh and ksh
|
||||||
|
|
||||||
_declare="declare -f"
|
which_declare="declare -f"
|
||||||
_opt="-f"
|
which_opt="-f"
|
||||||
_shell="$(basename $SHELL)"
|
which_shell="$(cat /proc/$$/comm)"
|
||||||
|
|
||||||
if [ "$_shell" = "ksh" ] || [ "$_shell" = "mksh" ] || [ "$_shell" = "zsh" ] ; then
|
if [ "$which_shell" = "ksh" ] || [ "$which_shell" = "mksh" ] || [ "$which_shell" = "zsh" ] ; then
|
||||||
_declare="typeset -f"
|
which_declare="typeset -f"
|
||||||
_opt=""
|
which_opt=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
which ()
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user