Skip to content

Commit e69ade3

Browse files
Stoiko Ivanovbehlendorf
authored andcommitted
contrib: bash_completion.d: make install destination vendor dependent
Certain Linux distributions (Debian/Ubuntu at least) expect bash-completion snippets to be installed in /usr/share/bash-completion/completions instead of /etc/bash_completion.d. This patch sets the bashcompletiondir variable based on the vendor, inspired by similar settings for initdir and initconfdir. It seems that commit 612b8df caused the file to be installed in the first-place (thus the error when building debian packages only became apparent when testing a 2.2.0-rc4 build) The change only sets the variable in Makefile context - the rpm/zfs.spec.in file has the path hardcoded as %{_sysconfdir}/bash_completion.d/zfs, but since running ``` ./configure --sysconfdir=/myetc ; make rpm ``` also results in all relevant files to be installed in /etc instead of /myetc I assume this can remain as is. Reviewed-by: Umer Saleem <[email protected]> Signed-off-by: Stoiko Ivanov <[email protected]> Closes #15304
1 parent 4e16964 commit e69ade3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

config/zfs-build.m4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,17 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
617617
AC_MSG_RESULT([no])
618618
fi
619619
AC_SUBST(RPM_DEFINE_INITRAMFS)
620+
621+
AC_MSG_CHECKING([default bash completion directory])
622+
case "$VENDOR" in
623+
ubuntu) bashcompletiondir=/usr/share/bash-completion/completions ;;
624+
debian) bashcompletiondir=/usr/share/bash-completion/completions ;;
625+
freebsd) bashcompletiondir=$sysconfdir/bash_completion.d;;
626+
*) bashcompletiondir=/etc/bash_completion.d ;;
627+
esac
628+
AC_MSG_RESULT([$bashcompletiondir])
629+
AC_SUBST(bashcompletiondir)
630+
620631
])
621632

622633
dnl #

contrib/bash_completion.d/Makefile.am

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
bashcompletiondir = $(sysconfdir)/bash_completion.d
2-
31
nodist_bashcompletion_DATA = %D%/zfs
42
SUBSTFILES += $(nodist_bashcompletion_DATA)
53

0 commit comments

Comments
 (0)