Package init

This commit is contained in:
overweight 2019-09-30 11:19:52 -04:00
commit e1ec28ac9d
5 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,27 @@
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;
}

BIN
which-2.21.tar.gz Normal file

Binary file not shown.

51
which.spec Normal file
View File

@ -0,0 +1,51 @@
Name: which
Version: 2.21
Release: 12
Summary: Show the full path of commands
License: GPLv3
URL: https://savannah.gnu.org/projects/which/
Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz
Source1: which2.sh
Source2: which2.csh
Patch0: which-2.21-coverity-fixes.patch
BuildRequires: gcc git
%description
Which takes one or more arguments. For each of its arguments it prints to stdout
the full path of the executables that would have been executed when this argument
had been entered at the shell prompt.
%package help
Summary: Help files for which
%description help
Contains documents and manuals files for which
%prep
%autosetup -n %{name}-%{version} -p1 -S git
%build
%configure
%make_build
%install
%make_install
mkdir -p %{buildroot}/%{_sysconfdir}/profile.d
install -p -m 0644 %{SOURCE1} %{SOURCE2} %{buildroot}/%{_sysconfdir}/profile.d
rm -f %{buildroot}/%{_datadir}/info/dir
%files
%doc AUTHORS
%license COPYING
%{_sysconfdir}/profile.d/%{name}*
%{_bindir}/%{name}
%files help
%doc EXAMPLES NEWS README
%{_mandir}/man1/%{name}.1.gz
%{_datadir}/info/%{name}.info.gz
%changelog
* Wed Aug 28 2019 luhuaxin <luhuaxin@huawei.com> - 2.21-12
- Package init

3
which2.csh Normal file
View File

@ -0,0 +1,3 @@
# Initialization script for csh
# alias which 'alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

7
which2.sh Normal file
View File

@ -0,0 +1,7 @@
# Initialization script for bash and sh
if [ "$0" = ksh ] ; then
alias which='(alias; typeset -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
else
alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
fi