diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2017-01-19 14:28:48 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-12-02 11:25:33 +0000 |
commit | a779b1d9fbbecad1d62847c0907fa809f13b9c2f (patch) | |
tree | c4a5f03ccf05d9c5e55af63331bb0948108cd23e | |
parent | 68f020f368f725b1930b3d053ebf542ad1dd34bc (diff) | |
download | poky-a779b1d9fbbecad1d62847c0907fa809f13b9c2f.tar.gz |
Revert "classes: Fix alternatives and rc.d ordering"
This kludge is not needed anymore, now that syslog packages (or any
other package) don't use update-alternatives for managing SysV init
scripts.
This reverts commit fc89a3f739ff25306ea91d9bdb424fc8389bdf72.
[YOCTO #10944]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/update-alternatives.bbclass | 29 | ||||
-rw-r--r-- | meta/classes/update-rc.d.bbclass | 20 |
2 files changed, 9 insertions, 40 deletions
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass index 4bba76c3ba..65cae7002f 100644 --- a/meta/classes/update-alternatives.bbclass +++ b/meta/classes/update-alternatives.bbclass | |||
@@ -201,8 +201,8 @@ python populate_packages_updatealternatives () { | |||
201 | pkgdest = d.getVar('PKGD') | 201 | pkgdest = d.getVar('PKGD') |
202 | for pkg in (d.getVar('PACKAGES') or "").split(): | 202 | for pkg in (d.getVar('PACKAGES') or "").split(): |
203 | # Create post install/removal scripts | 203 | # Create post install/removal scripts |
204 | alt_setup_links = "# Begin section update-alternatives\n" | 204 | alt_setup_links = "" |
205 | alt_remove_links = "# Begin section update-alternatives\n" | 205 | alt_remove_links = "" |
206 | for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split(): | 206 | for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split(): |
207 | alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name) | 207 | alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name) |
208 | alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name) | 208 | alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name) |
@@ -225,13 +225,10 @@ python populate_packages_updatealternatives () { | |||
225 | # Default to generate shell script.. eventually we may want to change this... | 225 | # Default to generate shell script.. eventually we may want to change this... |
226 | alt_target = os.path.normpath(alt_target) | 226 | alt_target = os.path.normpath(alt_target) |
227 | 227 | ||
228 | alt_setup_links += 'update-alternatives --install %s %s %s %s\n' % (alt_link, alt_name, alt_target, alt_priority) | 228 | alt_setup_links += '\tupdate-alternatives --install %s %s %s %s\n' % (alt_link, alt_name, alt_target, alt_priority) |
229 | alt_remove_links += 'update-alternatives --remove %s %s\n' % (alt_name, alt_target) | 229 | alt_remove_links += '\tupdate-alternatives --remove %s %s\n' % (alt_name, alt_target) |
230 | 230 | ||
231 | alt_setup_links += "# End section update-alternatives\n" | 231 | if alt_setup_links: |
232 | alt_remove_links += "# End section update-alternatives\n" | ||
233 | |||
234 | if len(alt_setup_links.splitlines()) > 2: | ||
235 | # RDEPENDS setup | 232 | # RDEPENDS setup |
236 | provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives') | 233 | provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives') |
237 | if provider: | 234 | if provider: |
@@ -241,24 +238,12 @@ python populate_packages_updatealternatives () { | |||
241 | bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg) | 238 | bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg) |
242 | bb.note('%s' % alt_setup_links) | 239 | bb.note('%s' % alt_setup_links) |
243 | postinst = d.getVar('pkg_postinst_%s' % pkg) or '#!/bin/sh\n' | 240 | postinst = d.getVar('pkg_postinst_%s' % pkg) or '#!/bin/sh\n' |
244 | postinst = postinst.splitlines(True) | 241 | postinst += alt_setup_links |
245 | try: | ||
246 | index = postinst.index('# Begin section update-rc.d\n') | ||
247 | postinst.insert(index, alt_setup_links) | ||
248 | except ValueError: | ||
249 | postinst.append(alt_setup_links) | ||
250 | postinst = ''.join(postinst) | ||
251 | d.setVar('pkg_postinst_%s' % pkg, postinst) | 242 | d.setVar('pkg_postinst_%s' % pkg, postinst) |
252 | 243 | ||
253 | bb.note('%s' % alt_remove_links) | 244 | bb.note('%s' % alt_remove_links) |
254 | prerm = d.getVar('pkg_prerm_%s' % pkg) or '#!/bin/sh\n' | 245 | prerm = d.getVar('pkg_prerm_%s' % pkg) or '#!/bin/sh\n' |
255 | prerm = prerm.splitlines(True) | 246 | prerm += alt_remove_links |
256 | try: | ||
257 | index = prerm.index('# End section update-rc.d\n') | ||
258 | prerm.insert(index + 1, alt_remove_links) | ||
259 | except ValueError: | ||
260 | prerm.append(alt_remove_links) | ||
261 | prerm = ''.join(prerm) | ||
262 | d.setVar('pkg_prerm_%s' % pkg, prerm) | 247 | d.setVar('pkg_prerm_%s' % pkg, prerm) |
263 | } | 248 | } |
264 | 249 | ||
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass index c3fefea5af..e1e0e04876 100644 --- a/meta/classes/update-rc.d.bbclass +++ b/meta/classes/update-rc.d.bbclass | |||
@@ -37,7 +37,6 @@ fi | |||
37 | PACKAGE_WRITE_DEPS += "update-rc.d-native" | 37 | PACKAGE_WRITE_DEPS += "update-rc.d-native" |
38 | 38 | ||
39 | updatercd_postinst() { | 39 | updatercd_postinst() { |
40 | # Begin section update-rc.d | ||
41 | if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then | 40 | if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then |
42 | if [ -n "$D" ]; then | 41 | if [ -n "$D" ]; then |
43 | OPT="-r $D" | 42 | OPT="-r $D" |
@@ -46,15 +45,12 @@ if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then | |||
46 | fi | 45 | fi |
47 | update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS} | 46 | update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS} |
48 | fi | 47 | fi |
49 | # End section update-rc.d | ||
50 | } | 48 | } |
51 | 49 | ||
52 | updatercd_prerm() { | 50 | updatercd_prerm() { |
53 | # Begin section update-rc.d | ||
54 | if ${@use_updatercd(d)} && [ -z "$D" -a -x "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then | 51 | if ${@use_updatercd(d)} && [ -z "$D" -a -x "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then |
55 | ${INIT_D_DIR}/${INITSCRIPT_NAME} stop || : | 52 | ${INIT_D_DIR}/${INITSCRIPT_NAME} stop || : |
56 | fi | 53 | fi |
57 | # End section update-rc.d | ||
58 | } | 54 | } |
59 | 55 | ||
60 | updatercd_postrm() { | 56 | updatercd_postrm() { |
@@ -115,25 +111,13 @@ python populate_packages_updatercd () { | |||
115 | postinst = d.getVar('pkg_postinst_%s' % pkg) | 111 | postinst = d.getVar('pkg_postinst_%s' % pkg) |
116 | if not postinst: | 112 | if not postinst: |
117 | postinst = '#!/bin/sh\n' | 113 | postinst = '#!/bin/sh\n' |
118 | postinst = postinst.splitlines(True) | 114 | postinst += localdata.getVar('updatercd_postinst') |
119 | try: | ||
120 | index = postinst.index('# End section update-alternatives\n') | ||
121 | postinst.insert(index + 1, localdata.getVar('updatercd_postinst')) | ||
122 | except ValueError: | ||
123 | postinst.append(localdata.getVar('updatercd_postinst')) | ||
124 | postinst = ''.join(postinst) | ||
125 | d.setVar('pkg_postinst_%s' % pkg, postinst) | 115 | d.setVar('pkg_postinst_%s' % pkg, postinst) |
126 | 116 | ||
127 | prerm = d.getVar('pkg_prerm_%s' % pkg) | 117 | prerm = d.getVar('pkg_prerm_%s' % pkg) |
128 | if not prerm: | 118 | if not prerm: |
129 | prerm = '#!/bin/sh\n' | 119 | prerm = '#!/bin/sh\n' |
130 | prerm = prerm.splitlines(True) | 120 | prerm += localdata.getVar('updatercd_prerm') |
131 | try: | ||
132 | index = prerm.index('# Begin section update-alternatives\n') | ||
133 | prerm.insert(index, localdata.getVar('updatercd_prerm')) | ||
134 | except ValueError: | ||
135 | prerm.append(localdata.getVar('updatercd_prerm')) | ||
136 | prerm = ''.join(prerm) | ||
137 | d.setVar('pkg_prerm_%s' % pkg, prerm) | 121 | d.setVar('pkg_prerm_%s' % pkg, prerm) |
138 | 122 | ||
139 | postrm = d.getVar('pkg_postrm_%s' % pkg) | 123 | postrm = d.getVar('pkg_postrm_%s' % pkg) |