summaryrefslogtreecommitdiffstats
path: root/meta/classes/update-alternatives.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-09 15:00:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-10 11:51:19 +0000
commitc8dee9b92dfd545852ecac8dc2adfc95ac02e957 (patch)
tree5f1b86954646a0f3bb914407994388a6a4346769 /meta/classes/update-alternatives.bbclass
parent5d3860f4a8abb8e95442b04f8b84a333af362fcd (diff)
downloadpoky-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/update-alternatives.bbclass')
-rw-r--r--meta/classes/update-alternatives.bbclass38
1 files changed, 19 insertions, 19 deletions
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index ba812210a7..e5ba6550d7 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -78,38 +78,38 @@ fi
78} 78}
79 79
80def update_alternatives_after_parse(d): 80def update_alternatives_after_parse(d):
81 if bb.data.getVar('ALTERNATIVE_LINKS', d) != None: 81 if d.getVar('ALTERNATIVE_LINKS') != None:
82 doinstall = bb.data.getVar('do_install', d, 0) 82 doinstall = d.getVar('do_install', 0)
83 doinstall += bb.data.getVar('update_alternatives_batch_doinstall', d, 0) 83 doinstall += d.getVar('update_alternatives_batch_doinstall', 0)
84 bb.data.setVar('do_install', doinstall, d) 84 d.setVar('do_install', doinstall)
85 return 85 return
86 86
87 if bb.data.getVar('ALTERNATIVE_NAME', d) == None: 87 if d.getVar('ALTERNATIVE_NAME') == None:
88 raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_NAME" % bb.data.getVar('FILE', d) 88 raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_NAME" % d.getVar('FILE')
89 if bb.data.getVar('ALTERNATIVE_PATH', d) == None: 89 if d.getVar('ALTERNATIVE_PATH') == None:
90 raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_PATH" % bb.data.getVar('FILE', d) 90 raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_PATH" % d.getVar('FILE')
91 91
92python __anonymous() { 92python __anonymous() {
93 update_alternatives_after_parse(d) 93 update_alternatives_after_parse(d)
94} 94}
95 95
96python populate_packages_prepend () { 96python populate_packages_prepend () {
97 pkg = bb.data.getVar('PN', d, 1) 97 pkg = d.getVar('PN', 1)
98 bb.note('adding update-alternatives calls to postinst/postrm for %s' % pkg) 98 bb.note('adding update-alternatives calls to postinst/postrm for %s' % pkg)
99 postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) 99 postinst = d.getVar('pkg_postinst_%s' % pkg, 1) or d.getVar('pkg_postinst', 1)
100 if not postinst: 100 if not postinst:
101 postinst = '#!/bin/sh\n' 101 postinst = '#!/bin/sh\n'
102 if bb.data.getVar('ALTERNATIVE_LINKS', d) != None: 102 if d.getVar('ALTERNATIVE_LINKS') != None:
103 postinst += bb.data.getVar('update_alternatives_batch_postinst', d, 1) 103 postinst += d.getVar('update_alternatives_batch_postinst', 1)
104 else: 104 else:
105 postinst += bb.data.getVar('update_alternatives_postinst', d, 1) 105 postinst += d.getVar('update_alternatives_postinst', 1)
106 bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) 106 d.setVar('pkg_postinst_%s' % pkg, postinst)
107 postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1) 107 postrm = d.getVar('pkg_postrm_%s' % pkg, 1) or d.getVar('pkg_postrm', 1)
108 if not postrm: 108 if not postrm:
109 postrm = '#!/bin/sh\n' 109 postrm = '#!/bin/sh\n'
110 if bb.data.getVar('ALTERNATIVE_LINKS', d) != None: 110 if d.getVar('ALTERNATIVE_LINKS') != None:
111 postrm += bb.data.getVar('update_alternatives_batch_postrm', d, 1) 111 postrm += d.getVar('update_alternatives_batch_postrm', 1)
112 else: 112 else:
113 postrm += bb.data.getVar('update_alternatives_postrm', d, 1) 113 postrm += d.getVar('update_alternatives_postrm', 1)
114 bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) 114 d.setVar('pkg_postrm_%s' % pkg, postrm)
115} 115}