Compare commits

...

No commits in common. 'i10cs' and 'c9' have entirely different histories.
i10cs ... c9

@ -2,12 +2,27 @@
# Initialization script for bash, sh, mksh and ksh # Initialization script for bash, sh, mksh and ksh
case "$(basename $(readlink /proc/$$/exe))" in case "$(basename $(readlink /proc/$$/exe))" in
*ksh*|zsh) *ksh*)
alias which='alias | /usr/bin/which --tty-only --read-alias --show-tilde --show-dot' which_declare=""
which_opt=""
;;
zsh)
which_declare="typeset -f"
which_opt=""
;; ;;
bash|sh) bash|sh)
alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot' which_declare="declare -f"
which_opt="-f"
;; ;;
*) *)
which_declare=""
which_opt=""
;; ;;
esac esac
function which {
(alias; eval ${which_declare}) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@
}
export which_declare
export ${which_opt} which

@ -1,19 +1,17 @@
%global has_which2_alias 1
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: 43%{?dist} Release: 29%{?dist}
License: GPL-3.0-only 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
Source2: which2.csh Source2: which2.csh
Patch0: which-2.21-coverity-fixes.patch Patch0: which-2.21-coverity-fixes.patch
Patch1: which-2.21-path_max.patch Patch1: which-2.21-path_max.patch
Url: https://savannah.gnu.org/projects/which/ Url: https://savannah.gnu.org/projects/which/
Requires: coreutils
BuildRequires: make BuildRequires: make
BuildRequires: gcc BuildRequires: gcc
BuildRequires: readline-devel BuildRequires: readline-devel
%description %description
@ -21,8 +19,10 @@ The which command shows the full pathname of a specified program, if
the specified program is in your PATH. the specified program is in your PATH.
%prep %prep
%autosetup -p1 %setup -q
%patch0 -p1 -b .coverity
%patch1 -p1 -b .path_max
%build %build
%configure %configure
%make_build %make_build
@ -31,92 +31,42 @@ the specified program is in your PATH.
%make_install %make_install
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
%if %{has_which2_alias} install -p -m 644 %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
install -p -m 644 %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
%endif
rm -f $RPM_BUILD_ROOT%{_infodir}/dir rm -f $RPM_BUILD_ROOT%{_infodir}/dir
%files %files
%license COPYING %license COPYING
%doc EXAMPLES README AUTHORS NEWS %doc EXAMPLES README AUTHORS NEWS
%if %{has_which2_alias}
%attr(0644,root,root) %{_sysconfdir}/profile.d/which2.* %attr(0644,root,root) %{_sysconfdir}/profile.d/which2.*
%endif
%{_bindir}/which %{_bindir}/which
%{_infodir}/which.info* %{_infodir}/which.info*
%{_mandir}/man1/which.1* %{_mandir}/man1/which.1*
%changelog %changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2.21-43 * Mon Mar 27 2023 Than Ngo <than@redhat.com> - 2.21-29
- Bump release for October 2024 mass rebuild: - Resolves: #2181974, which fails for long path
Resolves: RHEL-64018
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 2.21-42
- Rebuilt for MSVSphere 10
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.21-42
- Bump release for June 2024 mass rebuild
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-41
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Mar 08 2023 Than Ngo <than@redhat.com> - 2.21-39
- fixed #2175953, enable which2 alias
* Sun Feb 19 2023 Than Ngo <than@redhat.com> - 2.21-38
- migrated to SPDX license
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Nov 07 2022 Than Ngo <than@redhat.com> - 2.21-36 * Fri Apr 15 2022 Than Ngo <than@redhat.com> - 2.21-28
- which fails for long path - Resolves: #2050996, error on login when using ksh as the default shell
* Fri Aug 05 2022 Than Ngo <than@redhat.com> - 2.21-35 * Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.21-27
- disable which2 alias and function by default as it caused more problems than benefits - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-34 * Fri May 07 2021 Than Ngo <than@redhat.com> - 2.21-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - Related: #1940464, fixed unbound variable
* Wed Feb 09 2022 Than Ngo <than@redhat.com> - 2.21-33 * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.21-25
- make which2.sh script more robust, - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Dec 02 2021 Than Ngo <than@redhat.com> - 2.21-31
- check shell correctly
* Tue Oct 26 2021 Than Ngo <than@redhat.com> - 2.21-30
- disable the --read-functions option in korn shells
* Fri Oct 15 2021 Than Ngo <than@redhat.com> - 2.21-29
- Fixed regression, use export instead alias
* Sun Oct 10 2021 Than Ngo <than@redhat.com> - 2.21-28
- Resolves: #2009547, which treats function contents as aliases when parsing ksh
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue May 04 2021 Than Ngo <than@redhat.com> - 2.21-26
- Resolves: #1942153, fixed unbound variable
* Mon Apr 26 2021 Than Ngo <than@redhat.com> - 2.21-25
- improved which2.sh
* Tue Mar 23 2021 Than Ngo <than@redhat.com> - 2.21-24 * Tue Mar 23 2021 Than Ngo <than@redhat.com> - 2.21-24
- fixed regression if SHELL=zsh - fix regression in zsh
* Sun Mar 21 2021 Than Ngo <than@redhat.com> - 2.21-23 * Sun Mar 21 2021 Than Ngo <than@redhat.com> - 2.21-23
- fixed coverity issues
- improved which2.sh - improved which2.sh
* Thu Mar 18 2021 Than Ngo <than@redhat.com> - 2.21-22 * Thu Mar 18 2021 Than Ngo <than@redhat.com> - 2.21-22
- fixed syntax error testcase: a=b which ls - Resolves: #1940464, fixed syntax error testcase: a=b which ls
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-21 * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

Loading…
Cancel
Save