From a780643c4b6aa11e1a36965a69df7116477c7b4c Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Tue, 7 Dec 2004 22:05:47 +0000 Subject: Merge oe-devel@oe-devel.bkbits.net:packages.bb into handhelds.org:/home/kergoth/code/packages.bb 2004/12/07 04:58:25-06:00 ti.com!kergoth More updates per the core rename. 2004/12/07 04:46:51-06:00 ti.com!kergoth Update soundtracker per the core rename. 2004/12/07 04:44:14-06:00 ti.com!kergoth Merge 2004/12/07 04:42:38-06:00 ti.com!kergoth Updates per the recent rename of the oe core from 'oe' to 'bitbake'. BKrev: 41b6293b91LRHSxMOt6WnrZVAdLbFw --- classes/update-alternatives.bbclass | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 classes/update-alternatives.bbclass (limited to 'classes/update-alternatives.bbclass') diff --git a/classes/update-alternatives.bbclass b/classes/update-alternatives.bbclass new file mode 100644 index 0000000000..e69de29bb2 -- cgit v1.2.3 From c8e5702127e507e82e6f68a4b8c546803accea9d Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Thu, 30 Jun 2005 08:19:37 +0000 Subject: import clean BK tree at cset 1.3670 --- classes/update-alternatives.bbclass | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'classes/update-alternatives.bbclass') diff --git a/classes/update-alternatives.bbclass b/classes/update-alternatives.bbclass index e69de29bb2..6b2b547d5f 100644 --- a/classes/update-alternatives.bbclass +++ b/classes/update-alternatives.bbclass @@ -0,0 +1,33 @@ +# defaults +ALTERNATIVE_PRIORITY = "10" +ALTERNATIVE_LINK = "${bindir}/${ALTERNATIVE_NAME}" + +update_alternatives_postinst() { +update-alternatives --install ${ALTERNATIVE_LINK} ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH} ${ALTERNATIVE_PRIORITY} +} + +update_alternatives_postrm() { +update-alternatives --remove ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH} +} + +python __anonymous() { + if bb.data.getVar('ALTERNATIVE_NAME', d) == None: + raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_NAME" % bb.data.getVar('FILE', d) + if bb.data.getVar('ALTERNATIVE_PATH', d) == None: + raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_PATH" % bb.data.getVar('FILE', d) +} + +python populate_packages_prepend () { + pkg = bb.data.getVar('PN', d, 1) + bb.note('adding update-alternatives calls to postinst/postrm for %s' % pkg) + postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) + if not postinst: + postinst = '#!/bin/sh\n' + postinst += bb.data.getVar('update_alternatives_postinst', d, 1) + bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) + postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1) + if not postrm: + postrm = '#!/bin/sh\n' + postrm += bb.data.getVar('update_alternatives_postrm', d, 1) + bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) +} -- cgit v1.2.3