summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2018-11-29 08:57:20 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-03 12:20:01 +0000
commit9775741a20937cab6ccd0c359482bc08d1a2b2d6 (patch)
treef3af9a0f673dc0378337b18243d9c3d12b59518a /meta/classes
parent42fedcd96f41521a4c0b57684c1da64d2f1fdf3f (diff)
downloadpoky-9775741a20937cab6ccd0c359482bc08d1a2b2d6.tar.gz
classes/update-alternatives: Skip alternatives when disabled
Skips the update alternative steps for recipes that shouldn't have them enabled. Fixes errors like: nativesdk-bzip2-1.0.6-r5 do_package: bzip2: alternative target (/opt/poky/2.5+snapshot/sysroots/i686-pokysdk-mingw32/usr/bin/bunzip2 or /opt/poky/2.5+snapshot/sysroots/i686-pokysdk-mingw32/usr/bin/bunzip2.bzip2) does not exist, skipping... When building mingw SDKs [YOCTO #12962] (From OE-Core rev: d11576f569ee618a8e638eee3b1f17bf8a9d4264) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/update-alternatives.bbclass27
1 files changed, 22 insertions, 5 deletions
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index aa01058cf9..ee66379933 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -89,15 +89,21 @@ def ua_extend_depends(d):
89 if not 'virtual/update-alternatives' in d.getVar('PROVIDES'): 89 if not 'virtual/update-alternatives' in d.getVar('PROVIDES'):
90 d.appendVar('DEPENDS', ' virtual/${MLPREFIX}update-alternatives') 90 d.appendVar('DEPENDS', ' virtual/${MLPREFIX}update-alternatives')
91 91
92python __anonymous() { 92def update_alternatives_enabled(d):
93 # Update Alternatives only works on target packages... 93 # Update Alternatives only works on target packages...
94 if bb.data.inherits_class('native', d) or \ 94 if bb.data.inherits_class('native', d) or \
95 bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or \ 95 bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or \
96 bb.data.inherits_class('cross-canadian', d): 96 bb.data.inherits_class('cross-canadian', d):
97 return 97 return False
98 98
99 # Disable when targeting mingw32 (no target support) 99 # Disable when targeting mingw32 (no target support)
100 if d.getVar("TARGET_OS") == "mingw32": 100 if d.getVar("TARGET_OS") == "mingw32":
101 return False
102
103 return True
104
105python __anonymous() {
106 if not update_alternatives_enabled(d):
101 return 107 return
102 108
103 # compute special vardeps 109 # compute special vardeps
@@ -128,6 +134,11 @@ populate_packages[vardeps] += "${UPDALTVARS} ${@gen_updatealternativesvars(d)}"
128# the split and strip steps.. packagecopy seems to be the earliest reasonable 134# the split and strip steps.. packagecopy seems to be the earliest reasonable
129# place. 135# place.
130python perform_packagecopy_append () { 136python perform_packagecopy_append () {
137 if update_alternatives_enabled(d):
138 apply_update_alternative_renames(d)
139}
140
141def apply_update_alternative_renames(d):
131 # Check for deprecated usage... 142 # Check for deprecated usage...
132 pn = d.getVar('BPN') 143 pn = d.getVar('BPN')
133 if d.getVar('ALTERNATIVE_LINKS') != None: 144 if d.getVar('ALTERNATIVE_LINKS') != None:
@@ -194,11 +205,13 @@ python perform_packagecopy_append () {
194 os.unlink(src) 205 os.unlink(src)
195 else: 206 else:
196 bb.warn('%s: Unable to resolve dangling symlink: %s' % (pn, alt_target)) 207 bb.warn('%s: Unable to resolve dangling symlink: %s' % (pn, alt_target))
197}
198 208
199PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives " 209PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
200 210
201python populate_packages_updatealternatives () { 211python populate_packages_updatealternatives () {
212 if not update_alternatives_enabled(d):
213 return
214
202 pn = d.getVar('BPN') 215 pn = d.getVar('BPN')
203 216
204 # Do actual update alternatives processing 217 # Do actual update alternatives processing
@@ -252,10 +265,15 @@ python populate_packages_updatealternatives () {
252} 265}
253 266
254python package_do_filedeps_append () { 267python package_do_filedeps_append () {
268 if update_alternatives_enabled(d):
269 apply_update_alternative_provides(d)
270}
271
272def apply_update_alternative_provides(d):
255 pn = d.getVar('BPN') 273 pn = d.getVar('BPN')
256 pkgdest = d.getVar('PKGDEST') 274 pkgdest = d.getVar('PKGDEST')
257 275
258 for pkg in packages.split(): 276 for pkg in d.getVar('PACKAGES').split():
259 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split(): 277 for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
260 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name) 278 alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
261 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name) 279 alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
@@ -273,5 +291,4 @@ python package_do_filedeps_append () {
273 d.appendVar('FILERPROVIDES_%s_%s' % (trans_target, pkg), " " + alt_link) 291 d.appendVar('FILERPROVIDES_%s_%s' % (trans_target, pkg), " " + alt_link)
274 if not trans_target in (d.getVar('FILERPROVIDESFLIST_%s' % pkg) or ""): 292 if not trans_target in (d.getVar('FILERPROVIDESFLIST_%s' % pkg) or ""):
275 d.appendVar('FILERPROVIDESFLIST_%s' % pkg, " " + trans_target) 293 d.appendVar('FILERPROVIDESFLIST_%s' % pkg, " " + trans_target)
276}
277 294