Magellan Linux

Annotation of /trunk/include/gnome2.minc

Parent Directory Parent Directory | Revision Log Revision Log


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