summaryrefslogtreecommitdiffstats
path: root/meta/classes/update-alternatives.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-28 23:28:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-02 15:44:10 +0100
commitbb6ddc3691ab04162ec5fd69a2d5e7876713fd15 (patch)
tree76e376b01253c3aace1a98a5021bcaad3c92e861 /meta/classes/update-alternatives.bbclass
parentfcc456ee4b8f619134abb4649db53c638074082c (diff)
downloadpoky-bb6ddc3691ab04162ec5fd69a2d5e7876713fd15.tar.gz
Convert to new override syntax
This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". (From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/update-alternatives.bbclass')
-rw-r--r--meta/classes/update-alternatives.bbclass30
1 files changed, 15 insertions, 15 deletions
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index 000e4d5664..81ca05de0e 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -6,9 +6,9 @@
6# To use this class a number of variables should be defined: 6# To use this class a number of variables should be defined:
7# 7#
8# List all of the alternatives needed by a package: 8# List all of the alternatives needed by a package:
9# ALTERNATIVE_<pkg> = "name1 name2 name3 ..." 9# ALTERNATIVE:<pkg> = "name1 name2 name3 ..."
10# 10#
11# i.e. ALTERNATIVE_busybox = "sh sed test bracket" 11# i.e. ALTERNATIVE:busybox = "sh sed test bracket"
12# 12#
13# The pathname of the link 13# The pathname of the link
14# ALTERNATIVE_LINK_NAME[name] = "target" 14# ALTERNATIVE_LINK_NAME[name] = "target"
@@ -123,7 +123,7 @@ def gen_updatealternativesvars(d):
123 123
124 for p in pkgs: 124 for p in pkgs:
125 for v in vars: 125 for v in vars:
126 ret.append(v + "_" + p) 126 ret.append(v + ":" + p)
127 ret.append(v + "_VARDEPS_" + p) 127 ret.append(v + "_VARDEPS_" + p)
128 return " ".join(ret) 128 return " ".join(ret)
129 129
@@ -141,10 +141,10 @@ python apply_update_alternative_renames () {
141 import re 141 import re
142 142
143 def update_files(alt_target, alt_target_rename, pkg, d): 143 def update_files(alt_target, alt_target_rename, pkg, d):
144 f = d.getVar('FILES_' + pkg) 144 f = d.getVar('FILES:' + pkg)
145 if f: 145 if f:
146 f = re.sub(r'(^|\s)%s(\s|$)' % re.escape (alt_target), r'\1%s\2' % alt_target_rename, f) 146 f = re.sub(r'(^|\s)%s(\s|$)' % re.escape (alt_target), r'\1%s\2' % alt_target_rename, f)
147 d.setVar('FILES_' + pkg, f) 147 d.setVar('FILES:' + pkg, f)
148 148
149 # Check for deprecated usage... 149 # Check for deprecated usage...
150 pn = d.getVar('BPN') 150 pn = d.getVar('BPN')
@@ -156,7 +156,7 @@ python apply_update_alternative_renames () {
156 for pkg in (d.getVar('PACKAGES') or "").split(): 156 for pkg in (d.getVar('PACKAGES') or "").split():
157 # If the src == dest, we know we need to rename the dest by appending ${BPN} 157 # If the src == dest, we know we need to rename the dest by appending ${BPN}
158 link_rename = [] 158 link_rename = []
159 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split(): 159 for alt_name in (d.getVar('ALTERNATIVE:%s' % pkg) or "").split():
160 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name) 160 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
161 if not alt_link: 161 if not alt_link:
162 alt_link = "%s/%s" % (d.getVar('bindir'), alt_name) 162 alt_link = "%s/%s" % (d.getVar('bindir'), alt_name)
@@ -233,7 +233,7 @@ def update_alternatives_alt_targets(d, pkg):
233 pn = d.getVar('BPN') 233 pn = d.getVar('BPN')
234 pkgdest = d.getVar('PKGD') 234 pkgdest = d.getVar('PKGD')
235 updates = list() 235 updates = list()
236 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split(): 236 for alt_name in (d.getVar('ALTERNATIVE:%s' % pkg) or "").split():
237 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name) 237 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
238 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or \ 238 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or \
239 d.getVarFlag('ALTERNATIVE_TARGET', alt_name) or \ 239 d.getVarFlag('ALTERNATIVE_TARGET', alt_name) or \
@@ -259,7 +259,7 @@ def update_alternatives_alt_targets(d, pkg):
259 259
260 return updates 260 return updates
261 261
262PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives " 262PACKAGESPLITFUNCS:prepend = "populate_packages_updatealternatives "
263 263
264python populate_packages_updatealternatives () { 264python populate_packages_updatealternatives () {
265 if not update_alternatives_enabled(d): 265 if not update_alternatives_enabled(d):
@@ -280,24 +280,24 @@ python populate_packages_updatealternatives () {
280 provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives') 280 provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives')
281 if provider: 281 if provider:
282 #bb.note('adding runtime requirement for update-alternatives for %s' % pkg) 282 #bb.note('adding runtime requirement for update-alternatives for %s' % pkg)
283 d.appendVar('RDEPENDS_%s' % pkg, ' ' + d.getVar('MLPREFIX', False) + provider) 283 d.appendVar('RDEPENDS:%s' % pkg, ' ' + d.getVar('MLPREFIX', False) + provider)
284 284
285 bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg) 285 bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg)
286 bb.note('%s' % alt_setup_links) 286 bb.note('%s' % alt_setup_links)
287 postinst = d.getVar('pkg_postinst_%s' % pkg) 287 postinst = d.getVar('pkg_postinst:%s' % pkg)
288 if postinst: 288 if postinst:
289 postinst = alt_setup_links + postinst 289 postinst = alt_setup_links + postinst
290 else: 290 else:
291 postinst = '#!/bin/sh\n' + alt_setup_links 291 postinst = '#!/bin/sh\n' + alt_setup_links
292 d.setVar('pkg_postinst_%s' % pkg, postinst) 292 d.setVar('pkg_postinst:%s' % pkg, postinst)
293 293
294 bb.note('%s' % alt_remove_links) 294 bb.note('%s' % alt_remove_links)
295 prerm = d.getVar('pkg_prerm_%s' % pkg) or '#!/bin/sh\n' 295 prerm = d.getVar('pkg_prerm:%s' % pkg) or '#!/bin/sh\n'
296 prerm += alt_remove_links 296 prerm += alt_remove_links
297 d.setVar('pkg_prerm_%s' % pkg, prerm) 297 d.setVar('pkg_prerm:%s' % pkg, prerm)
298} 298}
299 299
300python package_do_filedeps_append () { 300python package_do_filedeps:append () {
301 if update_alternatives_enabled(d): 301 if update_alternatives_enabled(d):
302 apply_update_alternative_provides(d) 302 apply_update_alternative_provides(d)
303} 303}
@@ -307,7 +307,7 @@ def apply_update_alternative_provides(d):
307 pkgdest = d.getVar('PKGDEST') 307 pkgdest = d.getVar('PKGDEST')
308 308
309 for pkg in d.getVar('PACKAGES').split(): 309 for pkg in d.getVar('PACKAGES').split():
310 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split(): 310 for alt_name in (d.getVar('ALTERNATIVE:%s' % pkg) or "").split():
311 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name) 311 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
312 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name) 312 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
313 alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link 313 alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link