Magellan Linux

Annotation of /trunk/include/gnome2.minc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 72 - (hide annotations) (download)
Tue Sep 2 09:42:32 2014 UTC (9 years, 8 months ago) by niro
File size: 3504 byte(s)
-only run gconf, mime, desktop, icon, gio schemas functions if required
1 niro 1 # $Header: /magellan-cvs/mage/include/gnome2.minc,v 1.13 2008/04/10 21:56:38 niro Exp $
2    
3     # shall we run scrollkeeper ? (per default no)
4     : ${SCROLLKEEPER_UPDATE="0"}
5    
6     gn2_reload_gconf()
7     {
8     local pids
9    
10     if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
11     then
12     # have gconf reload the new schemas
13     pids=$(pgrep -x gconfd-2)
14     if [[ $? = 0 ]]
15     then
16     echo "Reloading gconf schemas ..."
17     kill -HUP ${pids}
18     fi
19     fi
20     }
21    
22     gn2_update_gconf()
23     {
24     # first update gconf
25     if [ -x ${MROOT}/usr/bin/gconftool-2 ]
26     then
27 niro 72 if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/etc/gconf/schemas ]
28     then
29     pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null
30     local schemas=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null)
31     popd &> /dev/null
32 niro 1
33 niro 72 # abort here, if no schemas where found
34     [[ -z ${schemas} ]] && return
35 niro 1
36 niro 72 echo "Updating gconf schemas ..."
37     export GCONF_CONFIG_SOURCE=$(${MROOT}/usr/bin/gconftool-2 --get-default-source)
38 niro 1
39 niro 72 local i
40     for i in ${schemas}
41     do
42     # echo "DEBUG::gconf install ${i}"
43     ${MROOT}/usr/bin/gconftool-2 --makefile-install-rule ${MROOT}/${i} 1>/dev/null
44     done
45     gn2_reload_gconf
46     fi
47 niro 1 fi
48     }
49    
50     gn2_update_scrollkeeper()
51     {
52     # than run scrollkeeper
53     if [ -x ${MROOT}/usr/bin/scrollkeeper-update ] &&
54     [[ ${SCROLLKEEPER_UPDATE} = 1 ]]
55     then
56     echo "Updating scrollkeeper ..."
57     ${MROOT}/usr/bin/scrollkeeper-update -q -p ${MROOT}/var/lib/scrollkeeper
58     fi
59     }
60    
61     gn2_update_desktop_db()
62     {
63     # update desktop db
64     if [ -x ${MROOT}/usr/bin/update-desktop-database ]
65     then
66 niro 72 if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/share/applications ]
67     then
68     echo "Updating desktop mime database ..."
69     ${MROOT}/usr/bin/update-desktop-database -q ${MROOT}/usr/share/applications
70     fi
71 niro 1 fi
72     }
73    
74     gn2_update_mime_db()
75     {
76     # update mime db
77     if [ -x ${MROOT}/usr/bin/update-mime-database ]
78     then
79 niro 72 if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/share/mime ]
80     then
81     echo "Updating shared mime info database ..."
82     ${MROOT}/usr/bin/update-mime-database ${MROOT}/usr/share/mime
83     fi
84 niro 1 fi
85     }
86    
87     gn2_update_icon_cache()
88     {
89     if [ -x ${MROOT}/usr/bin/gtk-update-icon-cache ]
90     then
91 niro 72 if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/share/icons ]
92     then
93     pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null
94     local icons=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
95     popd &> /dev/null
96 niro 1
97 niro 72 # abort here, if no icons where found
98     [[ -z ${icons} ]] && return
99    
100     echo "Updating icons cache ..."
101     local i
102     for i in ${icons}
103     do
104     if [[ -f ${MROOT}/${i}/index.theme ]]
105     then
106     ${MROOT}/usr/bin/gtk-update-icon-cache -qf ${MROOT}/${i}
107     fi
108     done
109     fi
110 niro 1 fi
111     }
112    
113 niro 45 gn2_update_schemas()
114     {
115     if [ -x ${MROOT}/usr/bin/glib-compile-schemas ]
116     then
117 niro 72 if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/share/glib-2.0/schemas ]
118     then
119     echo "Updating glib schemas ..."
120     ${MROOT}/usr/bin/glib-compile-schemas ${MROOT}/usr/share/glib-2.0/schemas
121     fi
122 niro 45 fi
123     }
124    
125     gn2_update_gio()
126     {
127     if [ -x ${MROOT}/usr/bin/gio-querymodules ]
128     then
129 niro 72 if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/$(mlibdir)/gio/modules ]
130     then
131     echo "Updating glib gio modules ..."
132     ${MROOT}/usr/bin/gio-querymodules ${MROOT}/usr/$(mlibdir)/gio/modules
133     fi
134 niro 45 fi
135     }
136    
137 niro 1 gn2_postinstall()
138     {
139     gn2_update_gconf
140     gn2_update_scrollkeeper
141 niro 45 gn2_update_schemas
142     gn2_update_gio
143 niro 1 gn2_update_desktop_db
144     gn2_update_mime_db
145     gn2_update_icon_cache
146     }
147    
148     gn2_postremove()
149     {
150     gn2_update_scrollkeeper
151 niro 45 gn2_update_schemas
152     gn2_update_gio
153 niro 1 gn2_update_desktop_db
154     gn2_update_mime_db
155     gn2_update_icon_cache
156     }
157    
158     export_inherits gn2 postinstall postremove