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 /meta/classes/update-alternatives.bbclass | |
| 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>
Diffstat (limited to 'meta/classes/update-alternatives.bbclass')
| -rw-r--r-- | meta/classes/update-alternatives.bbclass | 29 |
1 files changed, 7 insertions, 22 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 | ||
