summaryrefslogtreecommitdiffstats
path: root/meta/classes/syslinux.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-03 10:59:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-05 10:22:56 -0800
commit06f2f8ce0a3093973ca54b48f542f8485b666079 (patch)
treedbcfa5c491eb2e5d237aa539cb7c6e77dc07dd6f /meta/classes/syslinux.bbclass
parentd01dadfb87cfd2284b3e849d35a35fe5df0239c4 (diff)
downloadpoky-06f2f8ce0a3093973ca54b48f542f8485b666079.tar.gz
meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred. This patch is a sed over the meta directory of the form: sed \ -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \ -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \ -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/syslinux.bbclass')
-rw-r--r--meta/classes/syslinux.bbclass28
1 files changed, 14 insertions, 14 deletions
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index ec93201581..b194fa69a3 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -57,12 +57,12 @@ python build_syslinux_menu () {
57 import copy 57 import copy
58 import sys 58 import sys
59 59
60 workdir = d.getVar('WORKDIR', 1) 60 workdir = d.getVar('WORKDIR', True)
61 if not workdir: 61 if not workdir:
62 bb.error("WORKDIR is not defined") 62 bb.error("WORKDIR is not defined")
63 return 63 return
64 64
65 labels = d.getVar('LABELS', 1) 65 labels = d.getVar('LABELS', True)
66 if not labels: 66 if not labels:
67 bb.debug(1, "LABELS not defined, nothing to do") 67 bb.debug(1, "LABELS not defined, nothing to do")
68 return 68 return
@@ -71,7 +71,7 @@ python build_syslinux_menu () {
71 bb.debug(1, "No labels, nothing to do") 71 bb.debug(1, "No labels, nothing to do")
72 return 72 return
73 73
74 cfile = d.getVar('SYSLINUXMENU', 1) 74 cfile = d.getVar('SYSLINUXMENU', True)
75 if not cfile: 75 if not cfile:
76 raise bb.build.FuncFailed('Unable to read SYSLINUXMENU') 76 raise bb.build.FuncFailed('Unable to read SYSLINUXMENU')
77 77
@@ -100,7 +100,7 @@ python build_syslinux_menu () {
100 localdata.setVar('OVERRIDES', label + ':' + overrides) 100 localdata.setVar('OVERRIDES', label + ':' + overrides)
101 bb.data.update_data(localdata) 101 bb.data.update_data(localdata)
102 102
103 usage = localdata.getVar('USAGE', 1) 103 usage = localdata.getVar('USAGE', True)
104 cfgfile.write(' \x0F\x30\x3E%16s\x0F\x30\x37: ' % (label)) 104 cfgfile.write(' \x0F\x30\x3E%16s\x0F\x30\x37: ' % (label))
105 cfgfile.write('%s\n' % (usage)) 105 cfgfile.write('%s\n' % (usage))
106 106
@@ -114,12 +114,12 @@ python build_syslinux_cfg () {
114 import copy 114 import copy
115 import sys 115 import sys
116 116
117 workdir = d.getVar('WORKDIR', 1) 117 workdir = d.getVar('WORKDIR', True)
118 if not workdir: 118 if not workdir:
119 bb.error("WORKDIR not defined, unable to package") 119 bb.error("WORKDIR not defined, unable to package")
120 return 120 return
121 121
122 labels = d.getVar('LABELS', 1) 122 labels = d.getVar('LABELS', True)
123 if not labels: 123 if not labels:
124 bb.debug(1, "LABELS not defined, nothing to do") 124 bb.debug(1, "LABELS not defined, nothing to do")
125 return 125 return
@@ -128,7 +128,7 @@ python build_syslinux_cfg () {
128 bb.debug(1, "No labels, nothing to do") 128 bb.debug(1, "No labels, nothing to do")
129 return 129 return
130 130
131 cfile = d.getVar('SYSLINUXCFG', 1) 131 cfile = d.getVar('SYSLINUXCFG', True)
132 if not cfile: 132 if not cfile:
133 raise bb.build.FuncFailed('Unable to read SYSLINUXCFG') 133 raise bb.build.FuncFailed('Unable to read SYSLINUXCFG')
134 134
@@ -139,7 +139,7 @@ python build_syslinux_cfg () {
139 139
140 cfgfile.write('# Automatically created by OE\n') 140 cfgfile.write('# Automatically created by OE\n')
141 141
142 opts = d.getVar('SYSLINUX_OPTS', 1) 142 opts = d.getVar('SYSLINUX_OPTS', True)
143 143
144 if opts: 144 if opts:
145 for opt in opts.split(';'): 145 for opt in opts.split(';'):
@@ -148,26 +148,26 @@ python build_syslinux_cfg () {
148 cfgfile.write('ALLOWOPTIONS 1\n'); 148 cfgfile.write('ALLOWOPTIONS 1\n');
149 cfgfile.write('DEFAULT %s\n' % (labels.split()[0])) 149 cfgfile.write('DEFAULT %s\n' % (labels.split()[0]))
150 150
151 timeout = d.getVar('SYSLINUX_TIMEOUT', 1) 151 timeout = d.getVar('SYSLINUX_TIMEOUT', True)
152 152
153 if timeout: 153 if timeout:
154 cfgfile.write('TIMEOUT %s\n' % timeout) 154 cfgfile.write('TIMEOUT %s\n' % timeout)
155 else: 155 else:
156 cfgfile.write('TIMEOUT 50\n') 156 cfgfile.write('TIMEOUT 50\n')
157 157
158 prompt = d.getVar('SYSLINUX_PROMPT', 1) 158 prompt = d.getVar('SYSLINUX_PROMPT', True)
159 if prompt: 159 if prompt:
160 cfgfile.write('PROMPT %s\n' % prompt) 160 cfgfile.write('PROMPT %s\n' % prompt)
161 else: 161 else:
162 cfgfile.write('PROMPT 1\n') 162 cfgfile.write('PROMPT 1\n')
163 163
164 menu = d.getVar('AUTO_SYSLINUXMENU', 1) 164 menu = d.getVar('AUTO_SYSLINUXMENU', True)
165 165
166 # This is ugly. My bad. 166 # This is ugly. My bad.
167 167
168 if menu: 168 if menu:
169 bb.build.exec_func('build_syslinux_menu', d) 169 bb.build.exec_func('build_syslinux_menu', d)
170 mfile = d.getVar('SYSLINUXMENU', 1) 170 mfile = d.getVar('SYSLINUXMENU', True)
171 cfgfile.write('DISPLAY %s\n' % (mfile.split('/')[-1]) ) 171 cfgfile.write('DISPLAY %s\n' % (mfile.split('/')[-1]) )
172 172
173 for label in labels.split(): 173 for label in labels.split():
@@ -182,8 +182,8 @@ python build_syslinux_cfg () {
182 182
183 cfgfile.write('LABEL %s\nKERNEL /vmlinuz\n' % (label)) 183 cfgfile.write('LABEL %s\nKERNEL /vmlinuz\n' % (label))
184 184
185 append = localdata.getVar('APPEND', 1) 185 append = localdata.getVar('APPEND', True)
186 initrd = localdata.getVar('INITRD', 1) 186 initrd = localdata.getVar('INITRD', True)
187 187
188 if append: 188 if append:
189 cfgfile.write('APPEND ') 189 cfgfile.write('APPEND ')