Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df63b41eb6 | |||
| 1cd07ab32d |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/which-2.21.tar.gz
|
||||
which-2.21.tar.gz
|
||||
|
||||
@ -1 +0,0 @@
|
||||
6b6bec3d2b3d4661c164feb81b9b1d22d1359ded SOURCES/which-2.21.tar.gz
|
||||
@ -1,27 +0,0 @@
|
||||
diff -up which-2.21/tilde/tilde.c.me which-2.21/tilde/tilde.c
|
||||
--- which-2.21/tilde/tilde.c.me 2018-07-23 14:32:47.002225732 +0200
|
||||
+++ which-2.21/tilde/tilde.c 2018-07-23 14:49:06.363623898 +0200
|
||||
@@ -196,7 +196,8 @@ tilde_expand (string)
|
||||
int result_size, result_index;
|
||||
|
||||
result_index = result_size = 0;
|
||||
- if (result = strchr (string, '~'))
|
||||
+ result = strchr (string, '~');
|
||||
+ if (result)
|
||||
result = (char *)xmalloc (result_size = (strlen (string) + 16));
|
||||
else
|
||||
result = (char *)xmalloc (result_size = (strlen (string) + 1));
|
||||
diff -up which-2.21/which.c.me which-2.21/which.c
|
||||
diff -up which-2.21/which.c.me which-2.21/which.c
|
||||
--- which-2.21/which.c.me 2018-07-23 15:09:04.355222509 +0200
|
||||
+++ which-2.21/which.c 2018-07-25 14:57:43.696309701 +0200
|
||||
@@ -671,6 +671,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
+ if (abs_path)
|
||||
+ free(abs_path);
|
||||
+
|
||||
return fail_count;
|
||||
}
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
# shellcheck shell=sh
|
||||
# Initialization script for bash, sh, mksh and ksh
|
||||
|
||||
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
|
||||
|
||||
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
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
||||
SHA512 (which-2.21.tar.gz) = d2f04a5c5291f2d7d1226982da7cf999d36cfe24d3f7bda145508efcfb359511251d3c68b860c0ddcedd66b15a0587b648a35ab6d1f173707565305c506dfc61
|
||||
@ -1,7 +1,7 @@
|
||||
diff -up which-2.21/tilde/tilde.c.coverity2 which-2.21/tilde/tilde.c
|
||||
--- which-2.21/tilde/tilde.c.coverity2 2021-03-21 21:04:34.691775991 +0100
|
||||
+++ which-2.21/tilde/tilde.c 2021-03-21 21:13:36.853129481 +0100
|
||||
@@ -193,9 +193,8 @@ tilde_expand (string)
|
||||
diff -up which-2.21/tilde/tilde.c.coverity which-2.21/tilde/tilde.c
|
||||
--- which-2.21/tilde/tilde.c.coverity 2008-01-16 18:51:57.000000000 +0100
|
||||
+++ which-2.21/tilde/tilde.c 2021-03-21 11:43:00.338160051 +0100
|
||||
@@ -193,10 +193,10 @@ tilde_expand (string)
|
||||
const char *string;
|
||||
{
|
||||
char *result;
|
||||
@ -9,10 +9,13 @@ diff -up which-2.21/tilde/tilde.c.coverity2 which-2.21/tilde/tilde.c
|
||||
+ int result_size = 0, result_index = 0;
|
||||
|
||||
- result_index = result_size = 0;
|
||||
result = strchr (string, '~');
|
||||
if (result)
|
||||
- if (result = strchr (string, '~'))
|
||||
+ result = strchr (string, '~');
|
||||
+ if (result)
|
||||
result = (char *)xmalloc (result_size = (strlen (string) + 16));
|
||||
@@ -271,7 +270,7 @@ isolate_tilde_prefix (fname, lenp)
|
||||
else
|
||||
result = (char *)xmalloc (result_size = (strlen (string) + 1));
|
||||
@@ -270,7 +270,7 @@ isolate_tilde_prefix (fname, lenp)
|
||||
char *ret;
|
||||
int i;
|
||||
|
||||
@ -21,21 +24,21 @@ diff -up which-2.21/tilde/tilde.c.coverity2 which-2.21/tilde/tilde.c
|
||||
#if defined (__MSDOS__)
|
||||
for (i = 1; fname[i] && fname[i] != '/' && fname[i] != '\\'; i++)
|
||||
#else
|
||||
diff -up which-2.21/which.c.coverity2 which-2.21/which.c
|
||||
--- which-2.21/which.c.coverity2 2021-03-21 21:04:34.691775991 +0100
|
||||
+++ which-2.21/which.c 2021-03-21 21:04:34.692775983 +0100
|
||||
@@ -76,8 +76,9 @@ static int skip_functions = 0, read_func
|
||||
diff -up which-2.21/which.c.coverity which-2.21/which.c
|
||||
--- which-2.21/which.c.coverity 2015-03-19 17:50:24.000000000 +0100
|
||||
+++ which-2.21/which.c 2021-03-21 12:19:31.289160885 +0100
|
||||
@@ -76,16 +76,16 @@ static int skip_functions = 0, read_func
|
||||
|
||||
static char *find_command_in_path(const char *name, const char *path_list, int *path_index)
|
||||
{
|
||||
- char *found = NULL, *full_path;
|
||||
+ char *found = NULL, *full_path = NULL;
|
||||
int status, name_len;
|
||||
+ char *p;
|
||||
|
||||
name_len = strlen(name);
|
||||
+ char *p;
|
||||
|
||||
@@ -85,7 +86,6 @@ static char *find_command_in_path(const
|
||||
if (!absolute_program(name))
|
||||
absolute_path_given = 0;
|
||||
else
|
||||
{
|
||||
@ -1,16 +1,18 @@
|
||||
%global has_which2_alias 1
|
||||
|
||||
Summary: Displays where a particular program in your path is located
|
||||
Name: which
|
||||
Version: 2.21
|
||||
Release: 20%{?dist}
|
||||
License: GPLv3
|
||||
Release: 44%{?dist}
|
||||
License: GPL-3.0-only
|
||||
Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz
|
||||
Source1: which2.sh
|
||||
Source2: which2.csh
|
||||
Patch0: which-2.21-coverity-fixes.patch
|
||||
Patch1: which-2.21-coverity.patch
|
||||
Patch2: which-2.21-path_max.patch
|
||||
Patch1: which-2.21-path_max.patch
|
||||
Url: https://savannah.gnu.org/projects/which/
|
||||
Requires: coreutils
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
BuildRequires: readline-devel
|
||||
|
||||
@ -19,11 +21,8 @@ The which command shows the full pathname of a specified program, if
|
||||
the specified program is in your PATH.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .coverity
|
||||
%patch1 -p1 -b .coverity2
|
||||
%patch2 -p1 -b .path_max
|
||||
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
%configure
|
||||
%make_build
|
||||
@ -32,50 +31,126 @@ the specified program is in your PATH.
|
||||
%make_install
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
|
||||
install -p -m 644 %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
|
||||
%if %{has_which2_alias}
|
||||
install -p -m 644 %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
|
||||
%endif
|
||||
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
||||
|
||||
%files
|
||||
%license COPYING
|
||||
%doc EXAMPLES README AUTHORS NEWS
|
||||
%if %{has_which2_alias}
|
||||
%attr(0644,root,root) %{_sysconfdir}/profile.d/which2.*
|
||||
%endif
|
||||
%{_bindir}/which
|
||||
%{_infodir}/which.info*
|
||||
%{_mandir}/man1/which.1*
|
||||
|
||||
%changelog
|
||||
* Wed Mar 22 2023 Than Ngo <than@redhat.com> - 2.21-20
|
||||
- Related: #2140566, bring test over from Brew dist-git
|
||||
* Tue Jul 01 2025 Than Ngo <than@redhat.com> - 2.21-44
|
||||
- Add a check to ensure that /proc/$$/exe can be read
|
||||
Resolves: RHEL-97535
|
||||
|
||||
* Tue Mar 21 2023 Than Ngo <than@redhat.com> - 2.21-19
|
||||
- Resolves: #2140566, which fails for long path
|
||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2.21-43
|
||||
- Bump release for October 2024 mass rebuild:
|
||||
Resolves: RHEL-64018
|
||||
|
||||
* Mon Apr 11 2022 Than Ngo <than@redhat.com> - 2.21-18
|
||||
- Resolves: #2044450 - custom profile generates shell error
|
||||
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.21-42
|
||||
- Bump release for June 2024 mass rebuild
|
||||
|
||||
* Thu Nov 25 2021 Than Ngo <than@redhat.com> - 2.21-17
|
||||
- Resolves: #2025709, check shell correctly
|
||||
* 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
|
||||
- which fails for long path
|
||||
|
||||
* Fri Aug 05 2022 Than Ngo <than@redhat.com> - 2.21-35
|
||||
- disable which2 alias and function by default as it caused more problems than benefits
|
||||
|
||||
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-34
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Wed Feb 09 2022 Than Ngo <than@redhat.com> - 2.21-33
|
||||
- make which2.sh script more robust,
|
||||
|
||||
* 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
|
||||
|
||||
* Wed May 05 2021 Than Ngo <than@redhat.com> - 2.21-16
|
||||
- Related: #1940468, fixed unbound variable
|
||||
* 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
|
||||
|
||||
* 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
|
||||
* 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-14
|
||||
- Related: #1940468, fix regression if SHELL=zsh
|
||||
* Tue Mar 23 2021 Than Ngo <than@redhat.com> - 2.21-24
|
||||
- fixed regression if SHELL=zsh
|
||||
|
||||
* Fri Mar 19 2021 Than Ngo <than@redhat.com> - 2.21-13
|
||||
- Resolves: #1940468, fixed syntax error caused by testcase: a=b which ls
|
||||
Coverity issue
|
||||
* Sun Mar 21 2021 Than Ngo <than@redhat.com> - 2.21-23
|
||||
- fixed coverity issues
|
||||
- improved which2.sh
|
||||
|
||||
* Tue Nov 19 2019 Than Ngo <than@redhat.com> - 2.21-12
|
||||
- Fixed coverity issue
|
||||
* Thu Mar 18 2021 Than Ngo <than@redhat.com> - 2.21-22
|
||||
- fixed syntax error testcase: a=b which ls
|
||||
|
||||
* Tue Nov 19 2019 Than Ngo <than@redhat.com> - 2.21-11
|
||||
- Resolves: #1768506, fix wrong alias
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-21
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-20
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Wed Mar 25 2020 Than Ngo <than@redhat.com> - 2.21-19
|
||||
- fixed #1817138 - Invalid syntax in /etc/profile.d/which2
|
||||
|
||||
* Tue Mar 24 2020 Than Ngo <than@redhat.com> - 2.21-18
|
||||
- set correct alias for mksh
|
||||
|
||||
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-17
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Tue Nov 05 2019 Than Ngo <than@redhat.com> - 2.21-16
|
||||
- set correct alias for ksh
|
||||
|
||||
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-15
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Mon Feb 04 2019 Than Ngo <than@redhat.com> - 2.21-14
|
||||
- bump release
|
||||
|
||||
* Mon Feb 04 2019 Than Ngo <than@redhat.com> - 2.21-13
|
||||
- bump release
|
||||
|
||||
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Thu Jul 26 2018 Than Ngo <than@redhat.com> - 2.21-11
|
||||
- fixed more coverity issue
|
||||
|
||||
* Mon Jul 23 2018 Than Ngo <than@redhat.com> - 2.21-10
|
||||
- Fix coverity issues
|
||||
18
which2.sh
Normal file
18
which2.sh
Normal file
@ -0,0 +1,18 @@
|
||||
# shellcheck shell=sh
|
||||
# Initialization script for bash, sh, mksh and ksh
|
||||
|
||||
if [ -r /proc/$$/exe ]; then
|
||||
SHELLNAME=$(basename $(readlink /proc/$$/exe))
|
||||
else
|
||||
SHELLNAME="unknown"
|
||||
fi
|
||||
case "$SHELLNAME" in
|
||||
*ksh*|zsh)
|
||||
alias which='alias | /usr/bin/which --tty-only --read-alias --show-tilde --show-dot'
|
||||
;;
|
||||
bash|sh)
|
||||
alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
Loading…
Reference in New Issue
Block a user