Bug 862841 - Shell function "have()" is not defined and causes errors in bash completion scripts
Summary: Shell function "have()" is not defined and causes errors in bash completion s...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bash-completion
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-03 18:10 UTC by Christian
Modified: 2012-10-03 18:46 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-03 18:46:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Christian 2012-10-03 18:10:07 UTC
Description of problem:

/etc/bash_completion.d/grub seems to assume the function have() is available, but that's not the case.

Version-Release number of selected component (if applicable):

I've been seeing this problem for several releases now, starting around F15 and still happening in F17

How reproducible:

Always.

Steps to Reproduce:
1. Start a bash shell.
  
Actual results:

Shell reports errors:

bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found
bash: have: command not found

Expected results:

Bash should shut up. :)

Additional info:

I'm working around this via a conditional definition of have() in my own Bash scripts, but I feel I must be missing something. Is anyone else seeing this?

Comment 1 Ville Skyttä 2012-10-03 18:28:13 UTC
$ rpm -qf /etc/bash_completion.d/grub
grub2-tools-2.0-0.38.beta6.fc17.x86_64

So that file comes from grub2, not bash-completion.

Anyway, how are you loading /etc/bash_completion.d/grub? You shouldn't be loading anything from /etc/bash_completion.d "manually" in your startup files, bash-completion does it itself automatically when appropriate and when it does, the have() function is defined.

Comment 2 Christian 2012-10-03 18:46:48 UTC
Ah, I see -- I assumed the completion package maintains those files. I should have checked first.

I've dug deeper and I found that the problem is that my user's bash setup scripts prevent bash_completion.sh from being sourced, so the function isn't available.

Thanks!


Note You need to log in before you can comment on or make changes to this bug.