aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/bash-completion-directories.patch
blob: 351a8e02fbb02b01f9ec6a3d58be0ee1c9aefd7e (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Bash-completion is written with FHS in mind where completion scripts
all get added to /usr/share/bash-completion/completions and are picked
up by the dynamic completion loader from there---whether they are
part of bash-completion or installed by another package.

On Guix systems, we want not only to search within bash-completion's own
directory, but also in the user's profile and in the system profile.
This is what this patch does.


--- a/bash_completion	2016-08-03 10:23:02.356782287 +0200
+++ b/bash_completion	2016-08-03 10:27:50.120140403 +0200
@@ -1960,7 +1960,13 @@
 
 __load_completion()
 {
-    local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
+    local -a dirs=(
+        "$HOME/.guix-profile/share/bash-completion/completions/$base"
+        "$HOME/.guix-profile/etc/bash_completion.d/$base"
+        "/run/current-system/profile/share/bash-completion/completions/$base"
+        "/run/current-system/profile/etc/bash_completion.d/$base"
+        ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
+
     local OIFS=$IFS IFS=: dir cmd="$1" compfile
     for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
         dirs+=( $dir/bash-completion/completions )
pan title='2017-06-12 23:34:14 +0200'>2017-06-12marionette: Factorize 'wait-for-file'....Ludovic Courtès 2017-05-30activation: Change permissions on /root to #o700....Ludovic Courtès 2017-05-18services: user-homes: Do not create home directories marked as no-create....Ludovic Courtès 2017-05-13tests: "basic" test loads (guix …) modules from the right place....Ludovic Courtès 2017-05-13tests: Strengthen GC root test....Ludovic Courtès 2017-04-16services: 'service-parameters' becomes 'service-value'....Ludovic Courtès 2017-04-01tests: Introduce 'simple-operating-system' and use it....Ludovic Courtès 2017-02-08services: Add 'special-files-service-type'....Ludovic Courtès 2017-02-04activation: Set the right owner for home directories....Ludovic Courtès 2017-02-01system: Create home directories once 'file-systems' is up....Ludovic Courtès 2017-01-24services: Create /var/log/wtmp upon activation....Ludovic Courtès 2017-01-19services: Create /var/run/utmpx upon activation....Ludovic Courtès 2016-11-23tests: Remove 'GUIX_LOCPATH' hack that had been added for glibc@2.23....Ludovic Courtès 2016-11-23install: Enable "cryptodisk" handling in GRUB....Ludovic Courtès 2016-11-23marionette: Add 'marionette-screen-text' using OCR....Ludovic Courtès 2016-11-17tests: basic: Fix harmless thinko....Ludovic Courtès 2016-09-06services: syslog: Use syslog-configuration....David Craven 2016-08-31services: herd: Provide <live-service> objects....Ludovic Courtès 2016-08-29tests: Make sure /var/guix/gcroots/profiles is a valid symlink....Ludovic Courtès 2016-08-29tests: Make sure /run/current-system is a GC root....Ludovic Courtès 2016-08-02system: Define 'GUIX_LOCPATH' to work around 'glibc' package defect....Ludovic Courtès