Skip to content

Install bashcompletion file in appropriate location #15304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions config/zfs-build.m4
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,17 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
AC_MSG_RESULT([no])
fi
AC_SUBST(RPM_DEFINE_INITRAMFS)

AC_MSG_CHECKING([default bash completion directory])
case "$VENDOR" in
ubuntu) bashcompletiondir=/usr/share/bash-completion/completions ;;
debian) bashcompletiondir=/usr/share/bash-completion/completions ;;
freebsd) bashcompletiondir=$sysconfdir/bash_completion.d;;
*) bashcompletiondir=/etc/bash_completion.d ;;
esac
AC_MSG_RESULT([$bashcompletiondir])
AC_SUBST(bashcompletiondir)

])

dnl #
Expand Down
2 changes: 0 additions & 2 deletions contrib/bash_completion.d/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
bashcompletiondir = $(sysconfdir)/bash_completion.d

nodist_bashcompletion_DATA = %D%/zfs
SUBSTFILES += $(nodist_bashcompletion_DATA)

Expand Down
2 changes: 1 addition & 1 deletion contrib/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Priority: optional
Maintainer: ZFS on Linux specific mailing list <[email protected]>
Build-Depends: debhelper-compat (= 12),
dh-python,
dkms (>> 2.1.1.2-5),
dh-sequence-dkms | dkms (>> 2.1.1.2-5),
libaio-dev,
libblkid-dev,
libcurl4-openssl-dev,
Expand Down
1 change: 0 additions & 1 deletion contrib/debian/openzfs-zfsutils.install
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
etc/default/zfs
etc/zfs/zfs-functions
etc/zfs/zpool.d/
etc/bash_completion.d/zfs
lib/systemd/system-generators/
lib/systemd/system-preset/
lib/systemd/system/zfs-import-cache.service
Expand Down
5 changes: 0 additions & 5 deletions contrib/debian/rules.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ override_dh_auto_install:
@# Install the utilities.
$(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'

# Use upstream's bash completion
install -D -t '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/' \
'$(CURDIR)/contrib/bash_completion.d/zfs'

# Move from bin_dir to /usr/sbin
# Remove suffix (.py) as per policy 10.4 - Scripts
# https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
Expand Down Expand Up @@ -136,7 +132,6 @@ override_dh_auto_install:

chmod a-x '$(CURDIR)/debian/tmp/etc/zfs/zfs-functions'
chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs'
chmod a-x '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/zfs'

override_dh_python3:
dh_python3 -p openzfs-python3-pyzfs
Expand Down