summaryrefslogtreecommitdiffstats
path: root/meta/classes/update-alternatives.bbclass
diff options
context:
space:
mode:
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}