Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 526222

Summary: app-admin/drush: bash-completion is ugly
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Michael Orlitzky <mjo>
Status: RESOLVED FIXED    
Severity: normal CC: mjo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 521146    
Attachments: drush-6.4.0.ebuild
files/update-bash-completion-script-for-2.1.patch

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-10-21 12:57:11 UTC
* Problems with installed bash completions were found:
 * 
 * 	drush: does not define any completions (failed to source?).
 * 
 * For more details on installing bash-completions, please see:
 * https://wiki.gentoo.org/wiki/Bash/Installing_completion_files

And this is because the file does:

  # Ensure drush is available.
  which drush > /dev/null || alias drush &> /dev/null || return

In the ol' times you were supposed to use 'have()' function instead of relying on sys-apps/which. Nowadays you are not supposed to do any magic like this, and just assume it is available.

Also:

  # Register our completion function. We include common short aliases for Drush.
  complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush6 drush.php

We aren't really supposed to enable completions for commands we don't install.
Comment 1 Michael Orlitzky gentoo-dev 2014-10-22 00:34:56 UTC
Created attachment 387170 [details]
drush-6.4.0.ebuild

How's this look? I tested with bash-completion-2.1 and I guess it works, but I don't use bash-completion.
Comment 2 Michael Orlitzky gentoo-dev 2014-10-22 00:35:25 UTC
Created attachment 387172 [details, diff]
files/update-bash-completion-script-for-2.1.patch
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-10-22 07:44:06 UTC
Thanks, it seems to solve all the listed issues. Please commit.
Comment 4 Michael Orlitzky gentoo-dev 2014-10-24 16:35:43 UTC
I added myself as maintainer, too, so I can stable this in a month and get rid of the old versions.

*drush-6.4.0 (24 Oct 2014)

  24 Oct 2014; Michael Orlitzky <mjo@gentoo.org> +drush-6.4.0.ebuild,
  +files/update-bash-completion-script-for-2.1.patch, metadata.xml:
  Version bump to fix bug #526222, take over as maintainer.