diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-09 15:00:01 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-10 11:51:19 +0000 |
commit | c8dee9b92dfd545852ecac8dc2adfc95ac02e957 (patch) | |
tree | 5f1b86954646a0f3bb914407994388a6a4346769 /meta/classes/syslinux.bbclass | |
parent | 5d3860f4a8abb8e95442b04f8b84a333af362fcd (diff) | |
download | poky-c8dee9b92dfd545852ecac8dc2adfc95ac02e957.tar.gz |
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/syslinux.bbclass')
-rw-r--r-- | meta/classes/syslinux.bbclass | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass index fb7597470b..0cc6b851bc 100644 --- a/meta/classes/syslinux.bbclass +++ b/meta/classes/syslinux.bbclass | |||
@@ -8,12 +8,12 @@ python build_syslinux_menu () { | |||
8 | import copy | 8 | import copy |
9 | import sys | 9 | import sys |
10 | 10 | ||
11 | workdir = bb.data.getVar('WORKDIR', d, 1) | 11 | workdir = d.getVar('WORKDIR', 1) |
12 | if not workdir: | 12 | if not workdir: |
13 | bb.error("WORKDIR is not defined") | 13 | bb.error("WORKDIR is not defined") |
14 | return | 14 | return |
15 | 15 | ||
16 | labels = bb.data.getVar('LABELS', d, 1) | 16 | labels = d.getVar('LABELS', 1) |
17 | if not labels: | 17 | if not labels: |
18 | bb.debug(1, "LABELS not defined, nothing to do") | 18 | bb.debug(1, "LABELS not defined, nothing to do") |
19 | return | 19 | return |
@@ -22,7 +22,7 @@ python build_syslinux_menu () { | |||
22 | bb.debug(1, "No labels, nothing to do") | 22 | bb.debug(1, "No labels, nothing to do") |
23 | return | 23 | return |
24 | 24 | ||
25 | cfile = bb.data.getVar('SYSLINUXMENU', d, 1) | 25 | cfile = d.getVar('SYSLINUXMENU', 1) |
26 | if not cfile: | 26 | if not cfile: |
27 | raise bb.build.FuncFailed('Unable to read SYSLINUXMENU') | 27 | raise bb.build.FuncFailed('Unable to read SYSLINUXMENU') |
28 | 28 | ||
@@ -45,15 +45,15 @@ python build_syslinux_menu () { | |||
45 | from copy import deepcopy | 45 | from copy import deepcopy |
46 | localdata = deepcopy(d) | 46 | localdata = deepcopy(d) |
47 | 47 | ||
48 | overrides = bb.data.getVar('OVERRIDES', localdata) | 48 | overrides = localdata.getVar('OVERRIDES') |
49 | if not overrides: | 49 | if not overrides: |
50 | raise bb.build.FuncFailed('OVERRIDES not defined') | 50 | raise bb.build.FuncFailed('OVERRIDES not defined') |
51 | overrides = bb.data.expand(overrides, localdata) | 51 | overrides = bb.data.expand(overrides, localdata) |
52 | 52 | ||
53 | bb.data.setVar('OVERRIDES', label + ':' + overrides, localdata) | 53 | localdata.setVar('OVERRIDES', label + ':' + overrides) |
54 | bb.data.update_data(localdata) | 54 | bb.data.update_data(localdata) |
55 | 55 | ||
56 | usage = bb.data.getVar('USAGE', localdata, 1) | 56 | usage = localdata.getVar('USAGE', 1) |
57 | cfgfile.write(' \x0F\x30\x3E%16s\x0F\x30\x37: ' % (label)) | 57 | cfgfile.write(' \x0F\x30\x3E%16s\x0F\x30\x37: ' % (label)) |
58 | cfgfile.write('%s\n' % (usage)) | 58 | cfgfile.write('%s\n' % (usage)) |
59 | 59 | ||
@@ -67,12 +67,12 @@ python build_syslinux_cfg () { | |||
67 | import copy | 67 | import copy |
68 | import sys | 68 | import sys |
69 | 69 | ||
70 | workdir = bb.data.getVar('WORKDIR', d, 1) | 70 | workdir = d.getVar('WORKDIR', 1) |
71 | if not workdir: | 71 | if not workdir: |
72 | bb.error("WORKDIR not defined, unable to package") | 72 | bb.error("WORKDIR not defined, unable to package") |
73 | return | 73 | return |
74 | 74 | ||
75 | labels = bb.data.getVar('LABELS', d, 1) | 75 | labels = d.getVar('LABELS', 1) |
76 | if not labels: | 76 | if not labels: |
77 | bb.debug(1, "LABELS not defined, nothing to do") | 77 | bb.debug(1, "LABELS not defined, nothing to do") |
78 | return | 78 | return |
@@ -81,7 +81,7 @@ python build_syslinux_cfg () { | |||
81 | bb.debug(1, "No labels, nothing to do") | 81 | bb.debug(1, "No labels, nothing to do") |
82 | return | 82 | return |
83 | 83 | ||
84 | cfile = bb.data.getVar('SYSLINUXCFG', d, 1) | 84 | cfile = d.getVar('SYSLINUXCFG', 1) |
85 | if not cfile: | 85 | if not cfile: |
86 | raise bb.build.FuncFailed('Unable to read SYSLINUXCFG') | 86 | raise bb.build.FuncFailed('Unable to read SYSLINUXCFG') |
87 | 87 | ||
@@ -98,7 +98,7 @@ python build_syslinux_cfg () { | |||
98 | 98 | ||
99 | cfgfile.write('# Automatically created by OE\n') | 99 | cfgfile.write('# Automatically created by OE\n') |
100 | 100 | ||
101 | opts = bb.data.getVar('SYSLINUX_OPTS', d, 1) | 101 | opts = d.getVar('SYSLINUX_OPTS', 1) |
102 | 102 | ||
103 | if opts: | 103 | if opts: |
104 | for opt in opts.split(';'): | 104 | for opt in opts.split(';'): |
@@ -107,7 +107,7 @@ python build_syslinux_cfg () { | |||
107 | cfgfile.write('ALLOWOPTIONS 1\n'); | 107 | cfgfile.write('ALLOWOPTIONS 1\n'); |
108 | cfgfile.write('DEFAULT %s\n' % (labels.split()[0])) | 108 | cfgfile.write('DEFAULT %s\n' % (labels.split()[0])) |
109 | 109 | ||
110 | timeout = bb.data.getVar('SYSLINUX_TIMEOUT', d, 1) | 110 | timeout = d.getVar('SYSLINUX_TIMEOUT', 1) |
111 | 111 | ||
112 | if timeout: | 112 | if timeout: |
113 | cfgfile.write('TIMEOUT %s\n' % timeout) | 113 | cfgfile.write('TIMEOUT %s\n' % timeout) |
@@ -116,29 +116,29 @@ python build_syslinux_cfg () { | |||
116 | 116 | ||
117 | cfgfile.write('PROMPT 1\n') | 117 | cfgfile.write('PROMPT 1\n') |
118 | 118 | ||
119 | menu = bb.data.getVar('AUTO_SYSLINUXMENU', d, 1) | 119 | menu = d.getVar('AUTO_SYSLINUXMENU', 1) |
120 | 120 | ||
121 | # This is ugly. My bad. | 121 | # This is ugly. My bad. |
122 | 122 | ||
123 | if menu: | 123 | if menu: |
124 | bb.build.exec_func('build_syslinux_menu', d) | 124 | bb.build.exec_func('build_syslinux_menu', d) |
125 | mfile = bb.data.getVar('SYSLINUXMENU', d, 1) | 125 | mfile = d.getVar('SYSLINUXMENU', 1) |
126 | cfgfile.write('DISPLAY %s\n' % (mfile.split('/')[-1]) ) | 126 | cfgfile.write('DISPLAY %s\n' % (mfile.split('/')[-1]) ) |
127 | 127 | ||
128 | for label in labels.split(): | 128 | for label in labels.split(): |
129 | localdata = bb.data.createCopy(d) | 129 | localdata = bb.data.createCopy(d) |
130 | 130 | ||
131 | overrides = bb.data.getVar('OVERRIDES', localdata, True) | 131 | overrides = localdata.getVar('OVERRIDES', True) |
132 | if not overrides: | 132 | if not overrides: |
133 | raise bb.build.FuncFailed('OVERRIDES not defined') | 133 | raise bb.build.FuncFailed('OVERRIDES not defined') |
134 | 134 | ||
135 | bb.data.setVar('OVERRIDES', label + ':' + overrides, localdata) | 135 | localdata.setVar('OVERRIDES', label + ':' + overrides) |
136 | bb.data.update_data(localdata) | 136 | bb.data.update_data(localdata) |
137 | 137 | ||
138 | cfgfile.write('LABEL %s\nKERNEL vmlinuz\n' % (label)) | 138 | cfgfile.write('LABEL %s\nKERNEL vmlinuz\n' % (label)) |
139 | 139 | ||
140 | append = bb.data.getVar('APPEND', localdata, 1) | 140 | append = localdata.getVar('APPEND', 1) |
141 | initrd = bb.data.getVar('INITRD', localdata, 1) | 141 | initrd = localdata.getVar('INITRD', 1) |
142 | 142 | ||
143 | if append: | 143 | if append: |
144 | cfgfile.write('APPEND ') | 144 | cfgfile.write('APPEND ') |