diff options
| author | Richard Purdie <richard@openedhand.com> | 2005-08-31 10:45:47 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2005-08-31 10:45:47 +0000 |
| commit | 4b46c1f6e891b1ddd5968536440b888661fade3e (patch) | |
| tree | e0ba2c1f56f61b868bf746da5c4feabb25b800b2 /openembedded/classes/gconf.bbclass | |
| download | poky-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.gz | |
Initial population
git-svn-id: https://svn.o-hand.com/repos/poky@1 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/classes/gconf.bbclass')
| -rw-r--r-- | openembedded/classes/gconf.bbclass | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/openembedded/classes/gconf.bbclass b/openembedded/classes/gconf.bbclass new file mode 100644 index 0000000000..b0c5723873 --- /dev/null +++ b/openembedded/classes/gconf.bbclass | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | gconf_postinst() { | ||
| 2 | if [ "$1" = configure ]; then | ||
| 3 | if [ "x$D" != "x" ]; then | ||
| 4 | exit 1 | ||
| 5 | fi | ||
| 6 | SCHEMA_LOCATION=/etc/gconf/schemas | ||
| 7 | for SCHEMA in ${SCHEMA_FILES}; do | ||
| 8 | if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then | ||
| 9 | HOME=/root GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ | ||
| 10 | gconftool-2 \ | ||
| 11 | --makefile-install-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null | ||
| 12 | fi | ||
| 13 | done | ||
| 14 | fi | ||
| 15 | } | ||
| 16 | |||
| 17 | gconf_prerm() { | ||
| 18 | if [ "$1" = remove ] || [ "$1" = upgrade ]; then | ||
| 19 | SCHEMA_LOCATION=/etc/gconf/schemas | ||
| 20 | for SCHEMA in ${SCHEMA_FILES}; do | ||
| 21 | if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then | ||
| 22 | HOME=/root GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ | ||
| 23 | gconftool-2 \ | ||
| 24 | --makefile-uninstall-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null | ||
| 25 | fi | ||
| 26 | done | ||
| 27 | fi | ||
| 28 | } | ||
| 29 | |||
| 30 | python populate_packages_append () { | ||
| 31 | import os.path, re | ||
| 32 | packages = bb.data.getVar('PACKAGES', d, 1).split() | ||
| 33 | workdir = bb.data.getVar('WORKDIR', d, 1) | ||
| 34 | |||
| 35 | for pkg in packages: | ||
| 36 | schema_dir = '%s/install/%s/etc/gconf/schemas' % (workdir, pkg) | ||
| 37 | schemas = [] | ||
| 38 | schema_re = re.compile(".*\.schemas$") | ||
| 39 | if os.path.exists(schema_dir): | ||
| 40 | for f in os.listdir(schema_dir): | ||
| 41 | if schema_re.match(f): | ||
| 42 | schemas.append(f) | ||
| 43 | if schemas != []: | ||
| 44 | bb.note("adding gconf postinst and prerm scripts to %s" % pkg) | ||
| 45 | bb.data.setVar('SCHEMA_FILES', " ".join(schemas), d) | ||
| 46 | postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) | ||
| 47 | if not postinst: | ||
| 48 | postinst = '#!/bin/sh\n' | ||
| 49 | postinst += bb.data.getVar('gconf_postinst', d, 1) | ||
| 50 | bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) | ||
| 51 | prerm = bb.data.getVar('pkg_prerm_%s' % pkg, d, 1) or bb.data.getVar('pkg_prerm', d, 1) | ||
| 52 | if not prerm: | ||
| 53 | prerm = '#!/bin/sh\n' | ||
| 54 | prerm += bb.data.getVar('gconf_prerm', d, 1) | ||
| 55 | bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d) | ||
| 56 | |||
| 57 | } | ||
