diff --git a/README.md b/README.md deleted file mode 100644 index 7342728d557c602f51c6d278bba9f3dd9faaf356..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ -Anolis OS -======================================= -# 代码仓库说明 -## 分支说明 ->进行代码开发工作时,请注意选择当前版本对应的分支 -* aX分支为对应大版本的主分支,如a8分支对应当前最新版本 -* aX.Y分支为对应小版本的维护分支,如a8.2分支对应8.2版本 -## 开发流程 -1. 首先fork目标分支到自己的namespace -2. 在自己的fork分支上做出修改 -3. 向对应的仓库中提交merge request,源分支为fork分支 diff --git a/which-2.21.tar.gz b/which-2.21.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ee8c4280545400c6e478bd82839f9ae2cf185995 Binary files /dev/null and b/which-2.21.tar.gz differ diff --git a/which.spec b/which.spec new file mode 100644 index 0000000000000000000000000000000000000000..2a3e19b1505af4df904dbd0d601ccc1fc9d1ff0a --- /dev/null +++ b/which.spec @@ -0,0 +1,46 @@ +Name: which +Version: 2.21 +Release: 1%{?dist} +Summary: Displays where a particular program in your path is located + +License: GPLv3 +URL: https://savannah.gnu.org/projects/which/ +Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz +Source1: which2.sh +Source2: which2.csh + +BuildRequires: make gcc readline-devel + +%description +The which command shows the full pathname of a specified program, if +the specified program is in your PATH. + +%prep +%autosetup + + +%build +%configure +%make_build + + +%install +rm -rf $RPM_BUILD_ROOT +%make_install + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d +install -p -m 644 %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ +rm -f $RPM_BUILD_ROOT%{_infodir}/dir + +%files +%license COPYING +%doc EXAMPLES README AUTHORS NEWS +%attr(0644,root,root) %{_sysconfdir}/profile.d/which2.* +%{_bindir}/which +%{_infodir}/which.info* +%{_mandir}/man1/which.1* + + +%changelog +* Thu Mar 10 2022 forrest_ly - 2.21-1 +- Init for Anolis OS 23 diff --git a/which2.csh b/which2.csh new file mode 100644 index 0000000000000000000000000000000000000000..da9655e6a68e7bcbce86879b9e713ac57ed93fbd --- /dev/null +++ b/which2.csh @@ -0,0 +1,3 @@ +# Initialization script for csh + +# alias which 'alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' diff --git a/which2.sh b/which2.sh new file mode 100644 index 0000000000000000000000000000000000000000..6ef7979b1f61a0156d1fd3d9c9fa4965104ee95a --- /dev/null +++ b/which2.sh @@ -0,0 +1,19 @@ +# shellcheck shell=sh +# Initialization script for bash, sh, mksh and ksh + +which_declare="declare -f" +which_opt="-f" +which_shell="$(cat /proc/$$/comm)" + +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 "$@" +} + +export which_declare +export ${which_opt} which