Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 474380 - app-shells/bash-completion-2.1 - 'mount.linux': "File does not exist" when enabling 'mount' only
Summary: app-shells/bash-completion-2.1 - 'mount.linux': "File does not exist" when en...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-22 22:05 UTC by Emanuel Dávila
Modified: 2014-07-29 12:09 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emanuel Dávila 2013-06-22 22:05:04 UTC
When mount is enabled for bash-completion on linux it will try to load /etc/bash_completion.d/mount.linux instead of /etc/bash_completion.d/mount, as the last says in the begining of the file...

Reproducible: Always

Steps to Reproduce:
1.enable mount for bash-completion
2.prepare bash to use bash-completion
3.start bash...



the file is in ... 

/usr/share/bash-completion/mount.linux

so the file /etc/bash_completion.d/mount needs some fix in the first lines, I suppose...

work around...

cd /etc/bash_completion.d
ln -s ../../usr/share/bash-completion/mount.linux mount.linux
Comment 1 Denis M. (Phr33d0m) 2013-06-22 22:49:30 UTC
'mount' and 'mount.linux' are two different files (and, respectively, two different entries in `eselect bashcomp list`):

$ ▶ ll /usr/share/bash-completion/mount*
-rw-r--r-- 1 2.0K Jun  4 14:18 /usr/share/bash-completion/mount
-rw-r--r-- 1  11K Jun  4 14:18 /usr/share/bash-completion/mount.linux

$ ▶ eselect bashcomp list
[...]
  [268] mount
  [269] mount.linux

The issue here is that you have 'mount' enabled but not mount.linux - this causes the issue you're seeing. To fix this, enable mount.linux as well - it is necesary for 'mount' on linux systems as you have already figured.

(In reply to Emanuel Dávila from comment #0)
> so the file /etc/bash_completion.d/mount needs some fix in the first lines,

No actually.

IMO this bug is invalid but let's see if the shell-tools@ team has a suggestion of making this more obvious (having to enable 'mount.linux' as well if enabling 'mount' on linux systems).
Comment 2 Emanuel Dávila 2013-06-23 05:24:41 UTC
Both enabled...

=> eselect bashcomp list | grep mount            
  [125] fusermount
  [271] mount *
  [272] mount.linux *
  [273] mountpoint
  [428] umount
  [429] umount.linux

still shows the error...

I have this file...

/etc/bash_completion.d/mount -> ../../usr/share/bash-completion/mount

when loaded /etc/bash_completion.d/mount if the plataform is linux it looks for...

/etc/bash_completion.d/mount.linux

but isn't there...

I think mount.linux it's supposed to be automatically loaded if the plataform is linux, in the mount file...

if [[ $OSTYPE == *linux* ]]; then
    . "$BASH_SOURCE.linux"
    return
fi

but this doesn't get pointed to /usr/share/bash-completion/mount.linux but to /etc/bash_completion.d/mount.linux
Comment 3 Denis M. (Phr33d0m) 2013-06-23 08:28:12 UTC
(In reply to Emanuel Dávila from comment #2)
> Both enabled...
> 
> => eselect bashcomp list | grep mount            
>   [125] fusermount
>   [271] mount *
>   [272] mount.linux *
> 
> I have this file...
> 
> /etc/bash_completion.d/mount -> ../../usr/share/bash-completion/mount
When you enable 'mount.linux' through `eselect bashcomp` it creates the symlink
/etc/bash_completion.d/mount.linux -> ../../usr/share/bash-completion/mount.linux
If you didn't have that symlink *after* enabling 'mount.linux' that is a separate issue.


> I think mount.linux it's supposed to be automatically loaded if the
> plataform is linux, in the mount file...
I'm not sure if bashcomp works that way and can do things like this.


> but this doesn't get pointed to /usr/share/bash-completion/mount.linux but
> to /etc/bash_completion.d/mount.linux
Yes, that is the expected bahaviour. Probably the output from:
. "$BASH_SOURCE.linux"
should be sent to /dev/null to avoid unnecesary error messages if 'mount.linux' does not exist, but that is a decision for shell-tools@ to make.
Comment 4 Alexander Tsoy 2013-06-25 21:40:46 UTC
No problems when completions installed in default location and loaded dynamically. So I think this bug should depend on bug 472938 .
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2013-07-16 00:51:56 UTC
(In reply to Alexander Tsoy from comment #4)
> No problems when completions installed in default location and loaded
> dynamically. So I think this bug should depend on bug 472938 .

Following and closing this bug accordingly

If the problem is still there with 2.1-r1, reopen the bug