summaryrefslogtreecommitdiff
blob: 1c24f611a2d5aaa92896e21f9ca71189cf24183c (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
From 4851461c8f197d15220809cf1380299f5b1a493e Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Tue, 21 Oct 2014 12:09:06 -0400
Subject: [PATCH] bash-completion: Remove obsolete usage of 'have' function

Recent versions of bash-completion do not provide the 'have' function.
To keep things simple, this patch just removes it completely.
---
 ChangeLog                                      |  4 ++
 util/bash-completion.d/grub-completion.bash.in | 66 +++++---------------------
 2 files changed, 17 insertions(+), 53 deletions(-)

diff --git a/util/bash-completion.d/grub-completion.bash.in b/util/bash-completion.d/grub-completion.bash.in
index 44bf135..2b98004 100644
--- a/util/bash-completion.d/grub-completion.bash.in
+++ b/util/bash-completion.d/grub-completion.bash.in
@@ -165,15 +165,8 @@ _grub_set_entry () {
     fi
 }
 
-__grub_set_default_program="@grub_set_default@"
-have ${__grub_set_default_program} && \
-    complete -F _grub_set_entry -o filenames ${__grub_set_default_program}
-unset __grub_set_default_program
-
-__grub_reboot_program="@grub_reboot@"
-have ${__grub_reboot_program} && \
- complete -F _grub_set_entry -o filenames ${__grub_reboot_program}
-unset __grub_reboot_program
+complete -F _grub_set_entry -o filenames @grub_set_default@
+complete -F _grub_set_entry -o filenames @grub_reboot@
 
 
 #
@@ -197,10 +190,7 @@ _grub_editenv () {
                 create list set unset"
 }
 
-__grub_editenv_program="@grub_editenv@"
-have ${__grub_editenv_program} && \
- complete -F _grub_editenv -o filenames ${__grub_editenv_program}
-unset __grub_editenv_program
+complete -F _grub_editenv -o filenames @grub_editenv@
 
 
 #
@@ -218,10 +208,7 @@ _grub_mkconfig () {
         _filedir
     fi
 }
-__grub_mkconfig_program="@grub_mkconfig@"
-have ${__grub_mkconfig_program} && \
- complete -F _grub_mkconfig -o filenames ${__grub_mkconfig_program}
-unset __grub_mkconfig_program
+complete -F _grub_mkconfig -o filenames @grub_mkconfig@
 
 
 #
@@ -253,15 +240,8 @@ _grub_setup () {
     fi
 }
 
-__grub_bios_setup_program="@grub_bios_setup@"
-have ${__grub_bios_setup_program} && \
- complete -F _grub_setup -o filenames ${__grub_bios_setup_program}
-unset __grub_bios_setup_program
-
-__grub_sparc64_setup_program="@grub_sparc64_setup@"
-have ${__grub_sparc64_setup_program} && \
- complete -F _grub_setup -o filenames ${__grub_sparc64_setup_program}
-unset __grub_sparc64_setup_program
+complete -F _grub_setup -o filenames @grub_bios_setup@
+complete -F _grub_setup -o filenames @grub_sparc64_setup@
 
 
 #
@@ -304,10 +284,7 @@ _grub_install () {
         _filedir
     fi
 }
-__grub_install_program="@grub_install@"
-have ${__grub_install_program} && \
- complete -F _grub_install -o filenames ${__grub_install_program}
-unset __grub_install_program
+complete -F _grub_install -o filenames @grub_install@
 
 
 #
@@ -326,10 +303,7 @@ _grub_mkfont () {
         _filedir
     fi
 }
-__grub_mkfont_program="@grub_mkfont@"
-have ${__grub_mkfont_program} && \
- complete -F _grub_mkfont -o filenames ${__grub_mkfont_program}
-unset __grub_mkfont_program
+complete -F _grub_mkfont -o filenames @grub_mkfont@
 
 
 #
@@ -357,10 +331,7 @@ _grub_mkrescue () {
         _filedir
     fi
 }
-__grub_mkrescue_program="@grub_mkrescue@"
-have ${__grub_mkrescue_program} && \
- complete -F _grub_mkrescue -o filenames ${__grub_mkrescue_program}
-unset __grub_mkrescue_program
+complete -F _grub_mkrescue -o filenames @grub_mkrescue@
 
 
 #
@@ -399,10 +370,7 @@ _grub_mkimage () {
         _filedir
     fi
 }
-__grub_mkimage_program="@grub_mkimage@"
-have ${__grub_mkimage_program} && \
- complete -F _grub_mkimage -o filenames ${__grub_mkimage_program}
-unset __grub_mkimage_program
+complete -F _grub_mkimage -o filenames @grub_mkimage@
 
 
 #
@@ -421,10 +389,7 @@ _grub_mkpasswd_pbkdf2 () {
         _filedir
     fi
 }
-__grub_mkpasswd_pbkdf2_program="@grub_mkpasswd_pbkdf2@"
-have ${__grub_mkpasswd_pbkdf2_program} && \
- complete -F _grub_mkpasswd_pbkdf2 -o filenames ${__grub_mkpasswd_pbkdf2_program}
-unset __grub_mkpasswd_pbkdf2_program
+complete -F _grub_mkpasswd_pbkdf2 -o filenames @grub_mkpasswd_pbkdf2@
 
 
 #
@@ -459,10 +424,7 @@ _grub_probe () {
         _filedir
     fi
 }
-__grub_probe_program="@grub_probe@"
-have ${__grub_probe_program} && \
- complete -F _grub_probe -o filenames ${__grub_probe_program}
-unset __grub_probe_program
+complete -F _grub_probe -o filenames @grub_probe@
 
 
 #
@@ -481,9 +443,7 @@ _grub_script_check () {
         _filedir
     fi
 }
-__grub_script_check_program="@grub_script_check@"
-have ${__grub_script_check_program} && \
- complete -F _grub_script_check -o filenames ${__grub_script_check_program}
+complete -F _grub_script_check -o filenames @grub_script_check@
 
 
 # Local variables:
-- 
2.2.0