Dnia 2014-08-26, o godz. 23:35:16 Michał Górny <mgo...@gentoo.org> napisał(a):
> Dnia 2014-08-26, o godz. 12:51:22 > Michał Górny <mgo...@gentoo.org> napisał(a): > > > I think the best way forward is to: > > > > 1. Teach 'old' eselect-bashcomp to find files in the new $completionsdir > > as well as the old location, and stabilize that soon. > > > > 2. Switch the eclass and ebuilds to use the new $completionsdir. While > > at it, make sure that ebuilds install completion files whose names > > conform to the new layout (portage QA check likely). > > > > 3. Do we need some specific documentation except for a regular news > > item? Where? > > > > 4. Unmask the new bash-completion and eselect-bashcomp. Add a news item > > explaining the sudden change :). > > A bit more details to the plan: > > > 1. Bump app-admin/eselect-bashcomp (or app-shells/bash-completion) > to install env.d file with ES_BASHCOMP_DIRS pointing to the new > $completionsdir. > > [...] > > 2. Change bash-completion-r1.eclass default to /completions subdir. > > [...] > > 3. Bump app-shells/bash-completion to respect current $completionsdir. > > [...] If anyone wishes to review this further, attached bash-completion ebuild changes for (1) and (3), and eclass changes for (2). Tested and confirmed working. -- Best regards, Michał Górny
--- bash-completion-2.1.ebuild 2014-01-19 11:12:43.000000000 +0100 +++ bash-completion-2.1-r1.ebuild 2014-08-27 00:19:35.277605486 +0200 @@ -3,7 +3,7 @@ # $Header: /var/cvsroot/gentoo-x86/app-shells/bash-completion/bash-completion-2.1.ebuild,v 1.6 2014/01/19 10:12:43 vapier Exp $ EAPI=5 -inherit prefix +inherit bash-completion-r1 prefix DESCRIPTION="Programmable Completion for bash" HOMEPAGE="http://bash-completion.alioth.debian.org/"; @@ -23,6 +23,14 @@ src_prepare() { cp "${FILESDIR}"/bash-completion.sh-gentoo-1.2 "${T}"/bash-completion.sh || die eprefixify "${T}"/bash-completion.sh + cp "${FILESDIR}"/bash-completion.pc "${T}"/ || die + # reuse paths from the eclass -- those can come from pkg-config + # or defaults. + sed -i \ + -e "/completionsdir/s@=.*\$@=$(get_bashcompdir)@" \ + -e "/helpersdir/s@=.*\$@=$(get_bashhelpersdir)@" \ + "${T}"/bash-completion.pc || die + find completions -name 'Makefile*' -exec rm -f {} + # Part of >=sys-apps/util-linux-2.23 wrt #468544 @@ -36,6 +44,10 @@ src_prepare() { # net-misc/networkmanager: rm -f completions/nmcli + + # Forward-compatibility with new install location, for eselect-bashcomp. + echo "ES_BASHCOMP_DIRS=\"${EPREFIX}/usr/share/bash-completion/completions\"" \ + > "${T}"/50bash_completion || die } src_configure() { :; } # no-op @@ -47,8 +59,7 @@ src_install() { doins "${T}"/bash-completion.sh # All files from contrib/ in source package get installed - insinto /usr/share/bash-completion - doins -r "${S}"/completions/* + dobashcomp "${S}"/completions/* awk -v D="$ED" ' BEGIN { out=".pre" } @@ -68,7 +79,9 @@ src_install() { # Installed to datadir instead of libdir because bash-completion(s) # are not ELF files. insinto /usr/share/pkgconfig - doins "${FILESDIR}"/bash-completion.pc + doins "${T}"/bash-completion.pc + + doenvd "${T}"/50bash_completion } pkg_postinst() {
Index: bash-completion-r1.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/bash-completion-r1.eclass,v retrieving revision 1.12 diff -u -B -r1.12 bash-completion-r1.eclass --- bash-completion-r1.eclass 22 Jan 2014 19:41:21 -0000 1.12 +++ bash-completion-r1.eclass 26 Aug 2014 22:24:29 -0000 @@ -57,7 +57,7 @@ _bash-completion-r1_get_bashcompdir() { debug-print-function ${FUNCNAME} "${@}" - _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion + _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion/completions } # @FUNCTION: _bash-completion-r1_get_helpersdir
signature.asc
Description: PGP signature