Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 526222 - app-admin/drush: bash-completion is ugly
Summary: app-admin/drush: bash-completion is ugly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michael Orlitzky
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: bashcomp2
  Show dependency tree
 
Reported: 2014-10-21 12:57 UTC by Michał Górny
Modified: 2014-10-24 16:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
drush-6.4.0.ebuild (drush-6.4.0.ebuild,1.68 KB, text/plain)
2014-10-22 00:34 UTC, Michael Orlitzky
Details
files/update-bash-completion-script-for-2.1.patch (update-bash-completion-script-for-2.1.patch,1.30 KB, patch)
2014-10-22 00:35 UTC, Michael Orlitzky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.