summaryrefslogtreecommitdiffstats
path: root/meta/classes/update-alternatives.bbclass
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-12-14 21:13:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-16 10:23:23 +0000
commitc4e2c59088765d1f1de7ec57cde91980f887c2ff (patch)
treea2fda8ac5916fb59a711e9220c2177008cca9347 /meta/classes/update-alternatives.bbclass
parentd5e67725ac11e3296cad104470931ffa16824b90 (diff)
downloadpoky-c4e2c59088765d1f1de7ec57cde91980f887c2ff.tar.gz
meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/update-alternatives.bbclass')
-rw-r--r--meta/classes/update-alternatives.bbclass52
1 files changed, 26 insertions, 26 deletions
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index 1fdd681315..65da9dadbe 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -66,8 +66,8 @@ ALTERNATIVE_PRIORITY = "10"
66UPDALTVARS = "ALTERNATIVE ALTERNATIVE_LINK_NAME ALTERNATIVE_TARGET ALTERNATIVE_PRIORITY" 66UPDALTVARS = "ALTERNATIVE ALTERNATIVE_LINK_NAME ALTERNATIVE_TARGET ALTERNATIVE_PRIORITY"
67 67
68def gen_updatealternativesvardeps(d): 68def gen_updatealternativesvardeps(d):
69 pkgs = (d.getVar("PACKAGES", True) or "").split() 69 pkgs = (d.getVar("PACKAGES") or "").split()
70 vars = (d.getVar("UPDALTVARS", True) or "").split() 70 vars = (d.getVar("UPDALTVARS") or "").split()
71 71
72 # First compute them for non_pkg versions 72 # First compute them for non_pkg versions
73 for v in vars: 73 for v in vars:
@@ -84,7 +84,7 @@ def gen_updatealternativesvardeps(d):
84 d.appendVar('%s_VARDEPS_%s' % (v,p), ' %s:%s' % (flag, d.getVarFlag('%s_%s' % (v,p), flag, False))) 84 d.appendVar('%s_VARDEPS_%s' % (v,p), ' %s:%s' % (flag, d.getVarFlag('%s_%s' % (v,p), flag, False)))
85 85
86def ua_extend_depends(d): 86def ua_extend_depends(d):
87 if not 'virtual/update-alternatives' in d.getVar('PROVIDES', True): 87 if not 'virtual/update-alternatives' in d.getVar('PROVIDES'):
88 d.appendVar('DEPENDS', ' virtual/${MLPREFIX}update-alternatives') 88 d.appendVar('DEPENDS', ' virtual/${MLPREFIX}update-alternatives')
89 89
90python __anonymous() { 90python __anonymous() {
@@ -103,8 +103,8 @@ python __anonymous() {
103 103
104def gen_updatealternativesvars(d): 104def gen_updatealternativesvars(d):
105 ret = [] 105 ret = []
106 pkgs = (d.getVar("PACKAGES", True) or "").split() 106 pkgs = (d.getVar("PACKAGES") or "").split()
107 vars = (d.getVar("UPDALTVARS", True) or "").split() 107 vars = (d.getVar("UPDALTVARS") or "").split()
108 108
109 for v in vars: 109 for v in vars:
110 ret.append(v + "_VARDEPS") 110 ret.append(v + "_VARDEPS")
@@ -123,23 +123,23 @@ populate_packages[vardeps] += "${UPDALTVARS} ${@gen_updatealternativesvars(d)}"
123# place. 123# place.
124python perform_packagecopy_append () { 124python perform_packagecopy_append () {
125 # Check for deprecated usage... 125 # Check for deprecated usage...
126 pn = d.getVar('BPN', True) 126 pn = d.getVar('BPN')
127 if d.getVar('ALTERNATIVE_LINKS', True) != None: 127 if d.getVar('ALTERNATIVE_LINKS') != None:
128 bb.fatal('%s: Use of ALTERNATIVE_LINKS/ALTERNATIVE_PATH/ALTERNATIVE_NAME is no longer supported, please convert to the updated syntax, see update-alternatives.bbclass for more info.' % pn) 128 bb.fatal('%s: Use of ALTERNATIVE_LINKS/ALTERNATIVE_PATH/ALTERNATIVE_NAME is no longer supported, please convert to the updated syntax, see update-alternatives.bbclass for more info.' % pn)
129 129
130 # Do actual update alternatives processing 130 # Do actual update alternatives processing
131 pkgdest = d.getVar('PKGD', True) 131 pkgdest = d.getVar('PKGD')
132 for pkg in (d.getVar('PACKAGES', True) or "").split(): 132 for pkg in (d.getVar('PACKAGES') or "").split():
133 # If the src == dest, we know we need to rename the dest by appending ${BPN} 133 # If the src == dest, we know we need to rename the dest by appending ${BPN}
134 link_rename = {} 134 link_rename = {}
135 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split(): 135 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
136 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True) 136 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
137 if not alt_link: 137 if not alt_link:
138 alt_link = "%s/%s" % (d.getVar('bindir', True), alt_name) 138 alt_link = "%s/%s" % (d.getVar('bindir'), alt_name)
139 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link) 139 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link)
140 140
141 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True) 141 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
142 alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) or alt_link 142 alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
143 # Sometimes alt_target is specified as relative to the link name. 143 # Sometimes alt_target is specified as relative to the link name.
144 alt_target = os.path.join(os.path.dirname(alt_link), alt_target) 144 alt_target = os.path.join(os.path.dirname(alt_link), alt_target)
145 145
@@ -189,23 +189,23 @@ python perform_packagecopy_append () {
189PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives " 189PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
190 190
191python populate_packages_updatealternatives () { 191python populate_packages_updatealternatives () {
192 pn = d.getVar('BPN', True) 192 pn = d.getVar('BPN')
193 193
194 # Do actual update alternatives processing 194 # Do actual update alternatives processing
195 pkgdest = d.getVar('PKGD', True) 195 pkgdest = d.getVar('PKGD')
196 for pkg in (d.getVar('PACKAGES', True) or "").split(): 196 for pkg in (d.getVar('PACKAGES') or "").split():
197 # Create post install/removal scripts 197 # Create post install/removal scripts
198 alt_setup_links = "" 198 alt_setup_links = ""
199 alt_remove_links = "" 199 alt_remove_links = ""
200 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split(): 200 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
201 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True) 201 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
202 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True) 202 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
203 alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) or alt_link 203 alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
204 # Sometimes alt_target is specified as relative to the link name. 204 # Sometimes alt_target is specified as relative to the link name.
205 alt_target = os.path.join(os.path.dirname(alt_link), alt_target) 205 alt_target = os.path.join(os.path.dirname(alt_link), alt_target)
206 206
207 alt_priority = d.getVarFlag('ALTERNATIVE_PRIORITY_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_PRIORITY', alt_name, True) 207 alt_priority = d.getVarFlag('ALTERNATIVE_PRIORITY_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_PRIORITY', alt_name, True)
208 alt_priority = alt_priority or d.getVar('ALTERNATIVE_PRIORITY_%s' % pkg, True) or d.getVar('ALTERNATIVE_PRIORITY', True) 208 alt_priority = alt_priority or d.getVar('ALTERNATIVE_PRIORITY_%s' % pkg) or d.getVar('ALTERNATIVE_PRIORITY')
209 209
210 # This shouldn't trigger, as it should have been resolved earlier! 210 # This shouldn't trigger, as it should have been resolved earlier!
211 if alt_link == alt_target: 211 if alt_link == alt_target:
@@ -224,32 +224,32 @@ python populate_packages_updatealternatives () {
224 224
225 if alt_setup_links: 225 if alt_setup_links:
226 # RDEPENDS setup 226 # RDEPENDS setup
227 provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives', True) 227 provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives')
228 if provider: 228 if provider:
229 #bb.note('adding runtime requirement for update-alternatives for %s' % pkg) 229 #bb.note('adding runtime requirement for update-alternatives for %s' % pkg)
230 d.appendVar('RDEPENDS_%s' % pkg, ' ' + d.getVar('MLPREFIX', False) + provider) 230 d.appendVar('RDEPENDS_%s' % pkg, ' ' + d.getVar('MLPREFIX', False) + provider)
231 231
232 bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg) 232 bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg)
233 bb.note('%s' % alt_setup_links) 233 bb.note('%s' % alt_setup_links)
234 postinst = d.getVar('pkg_postinst_%s' % pkg, True) or '#!/bin/sh\n' 234 postinst = d.getVar('pkg_postinst_%s' % pkg) or '#!/bin/sh\n'
235 postinst += alt_setup_links 235 postinst += alt_setup_links
236 d.setVar('pkg_postinst_%s' % pkg, postinst) 236 d.setVar('pkg_postinst_%s' % pkg, postinst)
237 237
238 bb.note('%s' % alt_remove_links) 238 bb.note('%s' % alt_remove_links)
239 prerm = d.getVar('pkg_prerm_%s' % pkg, True) or '#!/bin/sh\n' 239 prerm = d.getVar('pkg_prerm_%s' % pkg) or '#!/bin/sh\n'
240 prerm += alt_remove_links 240 prerm += alt_remove_links
241 d.setVar('pkg_prerm_%s' % pkg, prerm) 241 d.setVar('pkg_prerm_%s' % pkg, prerm)
242} 242}
243 243
244python package_do_filedeps_append () { 244python package_do_filedeps_append () {
245 pn = d.getVar('BPN', True) 245 pn = d.getVar('BPN')
246 pkgdest = d.getVar('PKGDEST', True) 246 pkgdest = d.getVar('PKGDEST')
247 247
248 for pkg in packages.split(): 248 for pkg in packages.split():
249 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split(): 249 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
250 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True) 250 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
251 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True) 251 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
252 alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) or alt_link 252 alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
253 253
254 if alt_link == alt_target: 254 if alt_link == alt_target:
255 bb.warn('%s: alt_link == alt_target: %s == %s' % (pn, alt_link, alt_target)) 255 bb.warn('%s: alt_link == alt_target: %s == %s' % (pn, alt_link, alt_target))
@@ -261,7 +261,7 @@ python package_do_filedeps_append () {
261 # Add file provide 261 # Add file provide
262 trans_target = oe.package.file_translate(alt_target) 262 trans_target = oe.package.file_translate(alt_target)
263 d.appendVar('FILERPROVIDES_%s_%s' % (trans_target, pkg), " " + alt_link) 263 d.appendVar('FILERPROVIDES_%s_%s' % (trans_target, pkg), " " + alt_link)
264 if not trans_target in (d.getVar('FILERPROVIDESFLIST_%s' % pkg, True) or ""): 264 if not trans_target in (d.getVar('FILERPROVIDESFLIST_%s' % pkg) or ""):
265 d.appendVar('FILERPROVIDESFLIST_%s' % pkg, " " + trans_target) 265 d.appendVar('FILERPROVIDESFLIST_%s' % pkg, " " + trans_target)
266} 266}
267 267