Skip to contentSkip to conversation

bash completions in GRUB

PATCH Bruce Dubbs 3 participants 3 messages Jan 10, 2019 – Jan 15, 2019

lore
Share & tools
lore
#0 lore raw

It appears that GRUB is not consistent with other applications when installing the bash completions script. I suggest the following patch:

util/bash-completion.d/Makefile.am +1 -1
index 136287cf1..a15bef9c9 100644
@@ -6,7 +6,7 @@ EXTRA_DIST = $(bash_completion_source)
 
 CLEANFILES = $(bash_completion_script) config.log
 
-bashcompletiondir = $(sysconfdir)/bash_completion.d
+bashcompletiondir = /usr/share/bash-completion/completions
 bashcompletion_DATA = $(bash_completion_script)
 
 $(bash_completion_script): $(bash_completion_source) 

$(top_builddir)/config.status

------

We do have a simple workaround by just moving the file after installation, but that shouldn't be needed.

Also, is there a new stable release being planned? If so is there a target date? The last release was April 2017.

-- Bruce Dubbs
linuxfromscratch.org

#1 lore raw
Quoted 2 lines · Bruce Dubbs

It appears that GRUB is not consistent with other applications when installing the bash completions script. I suggest the following patch:

I don't think this is really right. /usr/share/bash-completion/completions has a somewhat different expected API for completion scripts than $(sysconfdir)/bash_completion.d did; it's not just a simple path change. In the new location, bash-completion expects to be able to autoload completion definitions by command name.

Here's what I did for Debian, but it needs a bit more work before being upstreamable IMO; the symlinks need to be installed by util/bash-completion.d/Makefile.am, and it may also be worth looking into splitting up the completion definitions into multiple files (since much of the point of how bash-completion is organised nowadays is to reduce the amount of code that bash has to read). Finally, for proper upstreaming I think the target directory ought to be settable at ./configure time.

https://salsa.debian.org/grub-team/grub/commit/48dbe1e38f23022211f347bd479de6036f622a3f

Signature · 1 line
Colin Watson                                       [[email protected]]
#2 lore raw
In reply to Bruce Dubbs
Quoted 19 lines · Bruce Dubbs

It appears that GRUB is not consistent with other applications when installing the bash completions script. I suggest the following patch:

util/bash-completion.d/Makefile.am +1 -1
index 136287cf1..a15bef9c9 100644
@@ -6,7 +6,7 @@ EXTRA_DIST = $(bash_completion_source)
 
 CLEANFILES = $(bash_completion_script) config.log
 
-bashcompletiondir = $(sysconfdir)/bash_completion.d
+bashcompletiondir = /usr/share/bash-completion/completions
 bashcompletion_DATA = $(bash_completion_script)
 
 $(bash_completion_script): $(bash_completion_source)

$(top_builddir)/config.status

Quoted 4 lines

------

We do have a simple workaround by just moving the file after installation, but that shouldn't be needed.

I think that solution proposed by Colin is better. If you want to work on that then you can start with the patches sent by him.

Quoted 2 lines

Also, is there a new stable release being planned? If so is there a target date? The last release was April 2017.

Yeah, we have to think about that. I hope that we announce something about it at the beginning of February.

Daniel