diff options
| author | Martin Jansa <Martin.Jansa@gmail.com> | 2013-02-04 18:05:04 +0100 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-02-06 15:16:01 +0100 |
| commit | 61911b23099c2658186179504ded318c987b5276 (patch) | |
| tree | aa06906b8a9f0e08253b560fd519a6f03f233d80 /meta-oe/classes | |
| parent | 4128325a4c87bcde6ac6ffe5dbf5d6d057ee4804 (diff) | |
| download | meta-openembedded-61911b23099c2658186179504ded318c987b5276.tar.gz | |
ttf: introduce update-fonts bbclass and change all ttf recipes to use it
* without this ttf.inc had to set RRECOMMENDS and
postinst/postrm without PN suffix to cover all
subpackages created in ttf recipes
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/classes')
| -rw-r--r-- | meta-oe/classes/update-fonts.bbclass | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/meta-oe/classes/update-fonts.bbclass b/meta-oe/classes/update-fonts.bbclass new file mode 100644 index 0000000000..db2e814a4f --- /dev/null +++ b/meta-oe/classes/update-fonts.bbclass | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | |||
| 2 | update_fonts_postinst() { | ||
| 3 | if [ -z "$D" ]; then | ||
| 4 | update-fonts | ||
| 5 | fi | ||
| 6 | } | ||
| 7 | |||
| 8 | # the same but keep it separate for now | ||
| 9 | update_fonts_postrm() { | ||
| 10 | if [ -z "$D" ]; then | ||
| 11 | update-fonts | ||
| 12 | fi | ||
| 13 | } | ||
| 14 | |||
| 15 | python populate_packages_append () { | ||
| 16 | update_fonts_pkgs = d.getVar('UPDATE_FONTS_PACKAGES', True).split() | ||
| 17 | |||
| 18 | for pkg in update_fonts_pkgs: | ||
| 19 | postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True) | ||
| 20 | if not postinst: | ||
| 21 | postinst = '#!/bin/sh\n' | ||
| 22 | postinst += d.getVar('update_fonts_postinst', True) | ||
| 23 | d.setVar('pkg_postinst_%s' % pkg, postinst) | ||
| 24 | |||
| 25 | postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True) | ||
| 26 | if not postrm: | ||
| 27 | postrm = '#!/bin/sh\n' | ||
| 28 | postrm += d.getVar('update_fonts_postrm', True) | ||
| 29 | d.setVar('pkg_postrm_%s' % pkg, postrm) | ||
| 30 | |||
| 31 | d.appendVar('RDEPENDS_%s' % pkg, ' font-update-common') | ||
| 32 | } | ||
| 33 | |||
| 34 | python __anonymous() { | ||
| 35 | if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d): | ||
| 36 | updatefonts_check = d.getVar('UPDATE_FONTS_PACKAGES') | ||
| 37 | if not updatefonts_check: | ||
| 38 | bb_filename = d.getVar('FILE') | ||
| 39 | raise bb.build.FuncFailed, "\n\n\nERROR: %s inherits update-fonts but doesn't set UPDATE_FONTS_PACKAGES" % bb_filename | ||
| 40 | } | ||
