Magellan Linux

Annotation of /trunk/include/gnome2.minc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 75 - (hide annotations) (download)
Tue Sep 2 11:26:21 2014 UTC (9 years, 8 months ago) by niro
File size: 3208 byte(s)
-be more informative
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 75 echo "Searching gconf schemas ..."
28 niro 73 pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null
29     local schemas=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null)
30     popd &> /dev/null
31 niro 1
32 niro 73 # abort here, if no schemas where found
33     [[ -z ${schemas} ]] && return
34 niro 1
35 niro 73 echo "Updating gconf schemas ..."
36     export GCONF_CONFIG_SOURCE=$(${MROOT}/usr/bin/gconftool-2 --get-default-source)
37 niro 1
38 niro 73 local i
39     for i in ${schemas}
40     do
41     # echo "DEBUG::gconf install ${i}"
42     ${MROOT}/usr/bin/gconftool-2 --makefile-install-rule ${MROOT}/${i} 1>/dev/null
43     done
44     gn2_reload_gconf
45 niro 1 fi
46     }
47    
48     gn2_update_scrollkeeper()
49     {
50     # than run scrollkeeper
51     if [ -x ${MROOT}/usr/bin/scrollkeeper-update ] &&
52     [[ ${SCROLLKEEPER_UPDATE} = 1 ]]
53     then
54     echo "Updating scrollkeeper ..."
55     ${MROOT}/usr/bin/scrollkeeper-update -q -p ${MROOT}/var/lib/scrollkeeper
56     fi
57     }
58    
59     gn2_update_desktop_db()
60     {
61     # update desktop db
62     if [ -x ${MROOT}/usr/bin/update-desktop-database ]
63     then
64 niro 73 echo "Updating desktop mime database ..."
65     ${MROOT}/usr/bin/update-desktop-database -q ${MROOT}/usr/share/applications
66 niro 1 fi
67     }
68    
69     gn2_update_mime_db()
70     {
71     # update mime db
72     if [ -x ${MROOT}/usr/bin/update-mime-database ]
73     then
74 niro 73 echo "Updating shared mime info database ..."
75     ${MROOT}/usr/bin/update-mime-database ${MROOT}/usr/share/mime
76 niro 1 fi
77     }
78    
79     gn2_update_icon_cache()
80     {
81 niro 74 local icons
82    
83 niro 1 if [ -x ${MROOT}/usr/bin/gtk-update-icon-cache ]
84     then
85 niro 74 if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/share/icons ]
86     then
87 niro 75 echo "Searching icon directories ..."
88 niro 74 pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null
89     icons=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
90     popd &> /dev/null
91     else
92     icons="usr/share/icons/hicolor"
93     fi
94 niro 1
95 niro 73 # abort here, if no icons where found
96     [[ -z ${icons} ]] && return
97    
98     echo "Updating icons cache ..."
99     local i
100     for i in ${icons}
101     do
102     if [[ -f ${MROOT}/${i}/index.theme ]]
103     then
104     ${MROOT}/usr/bin/gtk-update-icon-cache -qf ${MROOT}/${i}
105     fi
106     done
107 niro 1 fi
108     }
109    
110 niro 45 gn2_update_schemas()
111     {
112     if [ -x ${MROOT}/usr/bin/glib-compile-schemas ]
113     then
114 niro 73 echo "Updating glib schemas ..."
115     ${MROOT}/usr/bin/glib-compile-schemas ${MROOT}/usr/share/glib-2.0/schemas
116 niro 45 fi
117     }
118    
119     gn2_update_gio()
120     {
121     if [ -x ${MROOT}/usr/bin/gio-querymodules ]
122     then
123 niro 73 echo "Updating glib gio modules ..."
124     ${MROOT}/usr/bin/gio-querymodules ${MROOT}/usr/$(mlibdir)/gio/modules
125 niro 45 fi
126     }
127    
128 niro 1 gn2_postinstall()
129     {
130     gn2_update_gconf
131     gn2_update_scrollkeeper
132 niro 45 gn2_update_schemas
133     gn2_update_gio
134 niro 1 gn2_update_desktop_db
135     gn2_update_mime_db
136     gn2_update_icon_cache
137     }
138    
139     gn2_postremove()
140     {
141     gn2_update_scrollkeeper
142 niro 45 gn2_update_schemas
143     gn2_update_gio
144 niro 1 gn2_update_desktop_db
145     gn2_update_mime_db
146     gn2_update_icon_cache
147     }
148    
149     export_inherits gn2 postinstall postremove