Bug 382098 - zypper bash completion broken
Summary: zypper bash completion broken
Status: RESOLVED DUPLICATE of bug 382097
Alias: None
Product: openSUSE 11.0
Classification: openSUSE
Component: libzypp (show other bugs)
Version: Beta 1
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Jan Kupec
QA Contact: Duncan Mac-Vicar
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-21 20:32 UTC by Robin Knapp
Modified: 2008-04-22 18:32 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Knapp 2008-04-21 20:32:58 UTC
(text copied from Bug 382097)

I discovered some weird behaviour with bash completion:

Scenario 1:

- Start new bash
- type "yast <tab><tab>"
-> you will get a list of all yast modules
- type "zypper <tab>" 
-> you will get "zypper add-on"

huh?

Scenatio 2:

- Start new bash
- type "zypper <tab><tab>"
-> you will get a list of all zypper commands
- type "yast2 <tab><tab>"
-> you will still get a list of all zypper commands

huh²?


So I grepped around a bit in /etc/bash_completion.d and found out:

zypper.sh and yast2_completion.sh share a variable and do NOT declare it as local, the variable is "MODLIST"

Also, zypper.sh does initialize "MODLIST" as yast2-completion.sh does.

Fix:

1. yast2_completion.sh
- move "MODLIST=()" inside the function and declare as local

2. zypper.sh
- add "MODLIST=()" inside the function and declare as local

Both work fine with this fix, but I'm not 100% sure if that's the correct solution (not familiar with bash completion scripts)
Comment 1 Jan Kupec 2008-04-22 18:32:50 UTC

*** This bug has been marked as a duplicate of bug 382097 ***