Revert back to upstream _filedir override avoidance

Redefining `_filedir` has its share of problems, it causes additional
hoops to jump through if people want to override it with theirs for some
reason.

Refs https://github.com/scop/bash-completion/pull/667
This commit is contained in:
Ville Skyttä 2021-12-21 19:05:02 +02:00
parent c93709b04d
commit c6ed6a2fa9
2 changed files with 3 additions and 29 deletions

View File

@ -1,12 +0,0 @@
diff -up bash-completion-1.99/bash_completion~ bash-completion-1.99/bash_completion
--- bash-completion-1.99/bash_completion~ 2012-01-08 01:03:46.000000000 +0200
+++ bash-completion-1.99/bash_completion 2012-01-08 13:50:33.412012530 +0200
@@ -45,7 +45,7 @@ readonly BASH_COMPLETION_COMPAT_DIR
# Blacklisted completions, causing problems with our code.
#
-_blacklist_glob='@(acroread.sh)'
+_blacklist_glob='@()'
# Turn on extended globbing and programmable completion
shopt -s extglob progcomp

View File

@ -12,8 +12,6 @@ Summary: Programmable completion for Bash
License: GPLv2+
URL: https://github.com/scop/bash-completion
Source0: https://github.com/scop/bash-completion/releases/download/%{version}/%{name}-%{version}.tar.xz
# https://bugzilla.redhat.com/677446, see also redefine_filedir comments
Patch0: %{name}-1.99-noblacklist.patch
BuildArch: noarch
%if %{with tests}
@ -41,23 +39,8 @@ autoreconf -fi -v
%configure
%make_build
cat <<EOF >redefine_filedir
# This is a copy of the _filedir function in bash_completion, included
# and (re)defined separately here because some versions of Adobe
# Reader, if installed, are known to override this function with an
# incompatible version, causing various problems.
#
# https://bugzilla.redhat.com/677446
# http://forums.adobe.com/thread/745833
EOF
sed -ne '/^_filedir\s*(/,/^}/p' bash_completion >>redefine_filedir
%install
%make_install
install -Dpm 644 redefine_filedir \
%{buildroot}%{_sysconfdir}/bash_completion.d/redefine_filedir
# Updated completion shipped in cowsay package:
rm %{buildroot}%{_datadir}/bash-completion/completions/{cowsay,cowthink}
@ -93,6 +76,9 @@ make -C completions check
%changelog
* Tue Dec 21 2021 Ville Skyttä <ville.skytta@iki.fi>
- Revert back to upstream _filedir override avoidance
* Mon Nov 08 2021 Siteshwar Vashisht <svashisht@redhat.com> - 1:2.11-4
- Avoid conflict with makepkg completions in pacman
Resolves: #1819867