import which-2.21-17.el8

This commit is contained in:
CentOS Sources 2022-05-10 03:18:10 -04:00 committed by Stepan Oksanichenko
parent 39f4399ce4
commit 1ab0b0f1ed
2 changed files with 27 additions and 13 deletions

View File

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

View File

@ -1,7 +1,7 @@
Summary: Displays where a particular program in your path is located
Name: which
Version: 2.21
Release: 16%{?dist}
Release: 17%{?dist}
License: GPLv3
Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz
Source1: which2.sh
@ -9,7 +9,8 @@ Source2: which2.csh
Patch0: which-2.21-coverity-fixes.patch
Patch1: which-2.21-coverity.patch
Url: https://savannah.gnu.org/projects/which/
BuildRequires: gcc
Requires: coreutils
BuildRequires: gcc
BuildRequires: readline-devel
%description
@ -41,6 +42,10 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
%{_mandir}/man1/which.1*
%changelog
* Thu Nov 25 2021 Than Ngo <than@redhat.com> - 2.21-17
- Resolves: #2025709, check shell correctly
- Resolves: #2009547, which treats function contents as aliases when parsing ksh
* Wed May 05 2021 Than Ngo <than@redhat.com> - 2.21-16
- Related: #1940468, fixed unbound variable