Summary: | app-shells/bash-completion-2.1: use upstream build-sys, use upstream path(s) like /usr/share/bash-completion/completions, upstream completions autoloader etc. | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alexander Tsoy <alexander> |
Component: | Current packages | Assignee: | Gentoo Shell Tools project <shell-tools> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | casta, evgen.ibqn, mgorny, pacho, ssuominen |
Priority: | Normal | Keywords: | PMASKED |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 521146 | ||
Bug Blocks: | |||
Attachments: |
bash-completion-2.1-r1.ebuild
bash-completion-r1.eclass.patch From current 2.1 to 2.1-r1 build patch |
Description
Alexander Tsoy
2013-06-11 04:04:04 UTC
I did some work on gentoo-bashcomp last year before getting sidetracked. I'll try to get back to it and work on a migration plan. I think we should eventually get rid of the eselect module and load everything dynamically. The bulk of the work can be done in the eclass, but I'm thinking it's going to be tricky to handle both versions at the same time. It might be better to add an -r2 eclass and port ebuilds over. Created attachment 350854 [details, diff] bash-completion-r1.eclass.patch New functions get_bashcompdir and less used get_bashhelpersdir, - Use pkg-config (like systemd.eclass, udev.eclass, etc.) but have fallbacks for everything to cause minimal blockers. - Provide migration path to upstream bash-completion system. No bash-completion-r2.eclass required. Notes, As per Comment #1, gentoo-bashcomp is blocked from the new ebuild for now. Example usage, --- sys-fs/udisks/udisks-2.1.0.ebuild +++ sys-fs/udisks/udisks-2.1.0.ebuild @@ -80,7 +80,8 @@ keepdir /var/lib/udisks2 #383091 rm -rf "${ED}"/usr/share/bash-completion - dobashcomp data/completions/udisksctl + insinto "$(get_bashcompdir)" + doins data/completions/udisksctl local htmldir=udisks2 if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then Will attach the ebuild patch too. Created attachment 350856 [details, diff]
From current 2.1 to 2.1-r1 build patch
(In reply to Samuli Suominen from comment #2) > New functions get_bashcompdir and less used get_bashhelpersdir, See bug 469858 > As per Comment #1, gentoo-bashcomp is blocked from the new ebuild for now. gentoo-bashcomp works fine if completions enabled globally (eselect bashcomp enable --global {eselect,gentoo,repoman}). Also there is a quick temporary fix for gentoo-bashcomp: install completions in /etc/bash_completion.d/. -insinto /usr/share/bash-completion +insinto /etc/bash_completion.d (In reply to Samuli Suominen from comment #3) > +RDEPEND="|| ( >=app-shells/bash-3.2 app-shells/zsh ) From the README: "Use the full power of bash >= 4.1. We no longer support earlier bash versions, so you may as well use all the features of that version of bash to optimise your code. However, be careful when using features added since bash 4.1, since not everyone will be able to use them." > - elog "If you use non-login shells you still need to source" > - elog "/etc/profile.d/bash-completion.sh in your ~/.bashrc." Please add something like this into pkg_postinst(): elog "If you use non-login shells you still need to source" elog "/usr/share/bash-completion/bash_completion" elog "in your ~/.bashrc. For example:" elog "[[ \$PS1 && -f /usr/share/bash-completion/bash_completion ]] && \\" elog " . /usr/share/bash-completion/bash_completion" (In reply to Samuli Suominen from comment #2) > Created attachment 350854 [details, diff] [details, diff] > bash-completion-r1.eclass.patch > > New functions get_bashcompdir and less used get_bashhelpersdir, > > - Use pkg-config (like systemd.eclass, udev.eclass, etc.) but have fallbacks > for everything to cause minimal blockers. > > - Provide migration path to upstream bash-completion system. No > bash-completion-r2.eclass required. That's not a bad option, but I still like the simplicity of just being able to call dobashcomp. It's idiot-proof and if we ever need to hook in other features/fixes later we can do it once in the eclass rather than modify a ton of ebuilds. It also makes migrating ebuilds nothing but a simple tweak of the inherit line. (In reply to Ryan Hill from comment #5) > (In reply to Samuli Suominen from comment #2) > > Created attachment 350854 [details, diff] [details, diff] [details, diff] > > bash-completion-r1.eclass.patch > > > > New functions get_bashcompdir and less used get_bashhelpersdir, > > > > - Use pkg-config (like systemd.eclass, udev.eclass, etc.) but have fallbacks > > for everything to cause minimal blockers. > > > > - Provide migration path to upstream bash-completion system. No > > bash-completion-r2.eclass required. > > That's not a bad option, but I still like the simplicity of just being able > to call dobashcomp. It's idiot-proof and if we ever need to hook in other > features/fixes later we can do it once in the eclass rather than modify a > ton of ebuilds. It also makes migrating ebuilds nothing but a simple tweak > of the inherit line. Sure, the patch to the eclass just makes the dobashcomp use pkg-config to determine completionsdir You can keep on using it I completely missed that part of the patch. Looks good to me. Can we start preparing ebuilds which hardcodes /usr/share/bash-completion path for migration? get_bashcompdir() function is already supported by eclass [1]. If yes, then we need a tracker. [1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/bash-completion-r1.eclass?r1=1.3&r2=1.4 2.1-r1 in tree and eclass updated, closing *** Bug 477024 has been marked as a duplicate of this bug. *** Looks like this was dropped finally (In reply to Pacho Ramos from comment #11) > Looks like this was dropped finally I removed 2.1-r1 because some loud people complained they couldn't no longer prevent specific bash-completions from being loaded As in, 2.1-r1 no longer used eselect-bashcomp I personally used INSTALL_MASK to drop 2 problematic bash-completion files, and was fine with that solution, but this wasn't enough for everyone So, a new version of eselect-bashcomp "needs" to be created that works in a way that you can disable specific ones, like, move them out of /usr/share/bash-completion/completions/ to some temporary directory like /usr/share/bash-completion/completions.eselect/ I'm no longer working on this, I'm just clarifying why 2.1-r1 was removed, this is why, the lack of newly written eselect-bashcomp module that works reverse from the current one In case anyone wants to play with this, p.masked >=bash-completion-2.1-r90 is the (second attempt) initial ebuild. *** Bug 476992 has been marked as a duplicate of this bug. *** 2.1-r91 is now in ~arch. Enjoy the new issues! |