Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 935658 - app-shells/bash-completion-2.14.0 rsync completion fails if folder name have a space.
Summary: app-shells/bash-completion-2.14.0 rsync completion fails if folder name have ...
Status: UNCONFIRMED
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: 2024-07-06 07:44 UTC by David Duchesne
Modified: 2024-07-06 19:31 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 David Duchesne 2024-07-06 07:44:34 UTC
Hello,
Starting with bash-completion-2.14.0, rsync completion fails if a folder name have a space.

mkdir ab ac
rsync a [hit tab]
ab/ ac/
-> works as expected

mkdir "a b" "a c"
rsync a [hit tab]
[no output]
-> fails

If I add a folder without space -ad- :

mkdir "a b" "a c" ad
rsync a [hit tab]
a\ b/  a\ c/  ad/

Then it shows the choices as you can see but then if I type the backslash (thinking it would show a\ b/ & a\ c/) :
Code:	
rsync a\ [hit tab] -> no completion
[no output]

----

I can't downgrade to bash-completion-2.11 since it has already been removed from tree.
So I chrooted in an old snapshot (from two months ago with version 2.11), and :

mkdir "a b" "a c"
rsync a [hit tab]
a\ b/ a\ ac/	

mkdir "a b" "a c" ad
rsync a [hit tab]
a\ b/  a\ c/ ad/

No issue. All work as expected with 2.11.
I can reproduce the issue with a debian testing chroot (it features bash-completion-2.14 too), so it doesn't look like a configuration issue on my system.

Finally, this issue is only present with rsync completion. ls, cat (for example) for completion work fine, space or not.


Reproducible: Always
Comment 1 David Duchesne 2024-07-06 10:35:21 UTC
Sorry, little typo :

[...]
So I chrooted in an old snapshot (from two months ago with version 2.11), and :
[...]
#a\ b/ a\ ac/
a\ b/ a\ c/
Comment 2 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2024-07-06 16:16:35 UTC
Ideally this should be reported to upstream as an issue. I'll try to look if I can find the miss, but better you report it.
Comment 3 David Duchesne 2024-07-06 17:22:08 UTC
(In reply to Arthur Zamarin from comment #2)
> Ideally this should be reported to upstream as an issue. I'll try to look if
> I can find the miss, but better you report it.

Hello, just a little, hopefully useful info,
I unmerged bash-completion and manually compiled & installed straight from git repo (latest commit) : https://github.com/scop/bash-completion (The 9999 ebuild fails to install right now)

I ran again my test with "a b" "a c" and this time the rsync completion works.
My knowledge of bash is limited so I can't tell which commit fixed it. (to eventually make a patch until new release)
Comment 4 Larry the Git Cow gentoo-dev 2024-07-06 17:40:28 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eff4986d8bd2ee868edf18192102cc86262c1fdd

commit eff4986d8bd2ee868edf18192102cc86262c1fdd
Author:     Arthur Zamarin <arthurzam@gentoo.org>
AuthorDate: 2024-07-06 17:39:18 +0000
Commit:     Arthur Zamarin <arthurzam@gentoo.org>
CommitDate: 2024-07-06 17:40:16 +0000

    app-shells/bash-completion: fix live ebuild
    
    Bug: https://bugs.gentoo.org/935658
    Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>

 .../bash-completion/bash-completion-9999.ebuild     | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)
Comment 5 David Duchesne 2024-07-06 18:37:09 UTC
(In reply to David Duchesne from comment #3)
> Hello, just a little, hopefully useful info,
> I unmerged bash-completion and manually compiled & installed straight from
> git repo (latest commit) : https://github.com/scop/bash-completion (The 9999
> ebuild fails to install right now)
> 
> I ran again my test with "a b" "a c" and this time the rsync completion
> works.
> My knowledge of bash is limited so I can't tell which commit fixed it. (to
> eventually make a patch until new release)

Mmh, sorry when I installed manually, bash_completion.sh was not correctly installed. (It installs by default in /etc/profile.d ; which wasn't sourced)
As soon as I correctly put it in /etc/bash/bashrc.d; then it fails again.
I didn't realize it wasn't correctly installed first because I was using without rsync without argument.
So back with the same error..

~ mkdir "a b" "a c"
~ rsync -av a [hit tab]
It adds a backslash to the command "rsync -av a\ " but hitting tab again fails to show :
a\ b/ a\ c/

Now the 9999 is fixed, it will be easier to test, thanks. I'll have a look on how to report that on github even though I'm not feeling really comfortable about it.
Comment 6 David Duchesne 2024-07-06 19:31:18 UTC
https://github.com/scop/bash-completion/issues/1232