diff options
Diffstat (limited to 'meta/classes/update-rc.d.bbclass')
-rw-r--r-- | meta/classes/update-rc.d.bbclass | 20 |
1 files changed, 2 insertions, 18 deletions
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) |