bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata)
bb.data.update_data(localdata)
- postinst = '#!/bin/sh\n'
+ """
+ update_rc.d postinst is appended here because pkg_postinst may require to
+ execute on the target. Not doing so may cause update_rc.d postinst invoked
+ twice to cause unwanted warnings.
+ """
+ postinst = bb.data.getVar('pkg_postinst', localdata, 1)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
postinst += bb.data.getVar('updatercd_postinst', localdata, 1)
- try:
- postinst += bb.data.getVar('pkg_postinst', localdata, 1)
- except:
- pass
bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
+
prerm = bb.data.getVar('pkg_prerm', localdata, 1)
if not prerm:
prerm = '#!/bin/sh\n'
prerm += bb.data.getVar('updatercd_prerm', localdata, 1)
bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d)
+
postrm = bb.data.getVar('pkg_postrm', localdata, 1)
if not postrm:
postrm = '#!/bin/sh\n'