/[gentoo-x86]/eclass/gnome2-utils.eclass
Gentoo

Contents of /eclass/gnome2-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.36 - (hide annotations) (download)
Sat Mar 1 10:18:35 2014 UTC (8 months, 3 weeks ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.35: +7 -9 lines
Add multilib love for gnome2_gdk_pixbuf_update().

1 pacho 1.34 # Copyright 1999-2014 Gentoo Foundation
2 leonardop 1.1 # Distributed under the terms of the GNU General Public License v2
3 mgorny 1.36 # $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.35 2014/02/22 08:05:45 pacho Exp $
4 leonardop 1.1
5 eva 1.22 # @ECLASS: gnome2-utils.eclass
6 vapier 1.23 # @MAINTAINER:
7 eva 1.22 # gnome@gentoo.org
8     # @BLURB: Auxiliary functions commonly used by Gnome packages.
9     # @DESCRIPTION:
10     # This eclass provides a set of auxiliary functions needed by most Gnome
11     # packages. It may be used by non-Gnome packages as needed for handling various
12     # Gnome stack related functions such as:
13     # * Gtk+ icon cache management
14     # * GSettings schemas management
15     # * GConf schemas management
16     # * scrollkeeper (old Gnome help system) management
17 leonardop 1.1
18 eva 1.32 inherit multilib
19    
20 eva 1.18 case "${EAPI:-0}" in
21 axs 1.29 0|1|2|3|4|5) ;;
22 eva 1.18 *) die "EAPI=${EAPI} is not supported" ;;
23     esac
24 leonardop 1.1
25 eva 1.22 # @ECLASS-VARIABLE: GCONFTOOL_BIN
26     # @INTERNAL
27     # @DESCRIPTION:
28 leonardop 1.1 # Path to gconftool-2
29 eva 1.16 : ${GCONFTOOL_BIN:="/usr/bin/gconftool-2"}
30 leonardop 1.1
31 eva 1.22 # @ECLASS-VARIABLE: SCROLLKEEPER_DIR
32     # @INTERNAL
33     # @DESCRIPTION:
34 leonardop 1.1 # Directory where scrollkeeper-update should do its work
35 eva 1.16 : ${SCROLLKEEPER_DIR:="/var/lib/scrollkeeper"}
36 leonardop 1.1
37 eva 1.22 # @ECLASS-VARIABLE: SCROLLKEEPER_UPDATE_BIN
38     # @INTERNAL
39     # @DESCRIPTION:
40 leonardop 1.1 # Path to scrollkeeper-update
41 eva 1.16 : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
42 leonardop 1.1
43 eva 1.22 # @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
44     # @INTERNAL
45     # @DESCRIPTION:
46 eva 1.15 # Path to gtk-update-icon-cache
47     : ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
48    
49 eva 1.22 # @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
50     # @INTERNAL
51     # @DESCRIPTION:
52 eva 1.15 # Path to glib-compile-schemas
53     : ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
54    
55 eva 1.22 # @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS
56     # @INTERNAL
57     # @DEFAULT_UNSET
58     # @DESCRIPTION:
59     # List of GConf schemas provided by the package
60    
61     # @ECLASS-VARIABLE: GNOME2_ECLASS_ICONS
62     # @INTERNAL
63     # @DEFAULT_UNSET
64     # @DESCRIPTION:
65     # List of icons provided by the package
66    
67 eva 1.27 # @ECLASS-VARIABLE: GNOME2_ECLASS_SCROLLS
68     # @INTERNAL
69     # @DEFAULT_UNSET
70     # @DESCRIPTION:
71     # List of scrolls (documentation files) provided by the package
72    
73 eva 1.22 # @ECLASS-VARIABLE: GNOME2_ECLASS_GLIB_SCHEMAS
74     # @INTERNAL
75     # @DEFAULT_UNSET
76     # @DESCRIPTION:
77     # List of GSettings schemas provided by the package
78 leonardop 1.1
79 eva 1.32 # @ECLASS-VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS
80     # @INTERNAL
81     # @DEFAULT_UNSET
82     # @DESCRIPTION:
83     # List of gdk-pixbuf loaders provided by the package
84    
85 leonardop 1.1 DEPEND=">=sys-apps/sed-4"
86    
87    
88 tetromino 1.24 # @FUNCTION: gnome2_environment_reset
89     # @DESCRIPTION:
90     # Reset various variables inherited from root's evironment to a reasonable
91     # default for ebuilds to help avoid access violations and test failures.
92     gnome2_environment_reset() {
93     # Respected by >=glib-2.30.1-r1
94     export G_HOME="${T}"
95    
96     # GST_REGISTRY is to work around gst utilities trying to read/write /root
97     export GST_REGISTRY="${T}/registry.xml"
98    
99     # XXX: code for resetting XDG_* directories should probably be moved into
100     # a separate function in a non-gnome eclass
101     export XDG_DATA_HOME="${T}/.local/share"
102     export XDG_CONFIG_HOME="${T}/.config"
103     export XDG_CACHE_HOME="${T}/.cache"
104     export XDG_RUNTIME_DIR="${T}/run"
105     mkdir -p "${XDG_DATA_HOME}" "${XDG_CONFIG_HOME}" "${XDG_CACHE_HOME}" \
106     "${XDG_RUNTIME_DIR}"
107     # This directory needs to be owned by the user, and chmod 0700
108     # http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
109     chmod 0700 "${XDG_RUNTIME_DIR}"
110     }
111    
112 eva 1.22 # @FUNCTION: gnome2_gconf_savelist
113     # @DESCRIPTION:
114 remi 1.8 # Find the GConf schemas that are about to be installed and save their location
115 eva 1.22 # in the GNOME2_ECLASS_SCHEMAS environment variable.
116     # This function should be called from pkg_preinst.
117 remi 1.8 gnome2_gconf_savelist() {
118 eva 1.18 has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
119     pushd "${ED}" &> /dev/null
120 remi 1.10 export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null)
121 remi 1.8 popd &> /dev/null
122     }
123    
124 eva 1.22 # @FUNCTION: gnome2_gconf_install
125     # @DESCRIPTION:
126 leonardop 1.1 # Applies any schema files installed by the current ebuild to Gconf's database
127 eva 1.22 # using gconftool-2.
128     # This function should be called from pkg_postinst.
129 leonardop 1.1 gnome2_gconf_install() {
130 eva 1.18 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
131     local updater="${EROOT}${GCONFTOOL_BIN}"
132 remi 1.8
133 eva 1.16 if [[ ! -x "${updater}" ]]; then
134 eva 1.17 debug-print "${updater} is not executable"
135 remi 1.8 return
136     fi
137    
138     if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
139 eva 1.17 debug-print "No GNOME 2 GConf schemas found"
140 leonardop 1.1 return
141     fi
142    
143     # We are ready to install the GCONF Scheme now
144     unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
145 abcd 1.19 export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")"
146 leonardop 1.1
147     einfo "Installing GNOME 2 GConf schemas"
148    
149 eva 1.17 local F
150 remi 1.8 for F in ${GNOME2_ECLASS_SCHEMAS}; do
151 eva 1.18 if [[ -e "${EROOT}${F}" ]]; then
152 eva 1.17 debug-print "Installing schema: ${F}"
153 eva 1.18 "${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null
154 leonardop 1.1 fi
155     done
156    
157     # have gconf reload the new schemas
158 dang 1.6 pids=$(pgrep -x gconfd-2)
159 compnerd 1.3 if [[ $? == 0 ]] ; then
160     ebegin "Reloading GConf schemas"
161     kill -HUP ${pids}
162     eend $?
163     fi
164 leonardop 1.1 }
165    
166 eva 1.22 # @FUNCTION: gnome2_gconf_uninstall
167     # @DESCRIPTION:
168 leonardop 1.1 # Removes schema files previously installed by the current ebuild from Gconf's
169     # database.
170     gnome2_gconf_uninstall() {
171 eva 1.18 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
172     local updater="${EROOT}${GCONFTOOL_BIN}"
173 remi 1.8
174 eva 1.16 if [[ ! -x "${updater}" ]]; then
175 eva 1.17 debug-print "${updater} is not executable"
176 remi 1.8 return
177     fi
178    
179     if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
180 eva 1.17 debug-print "No GNOME 2 GConf schemas found"
181 leonardop 1.1 return
182     fi
183    
184     unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
185 abcd 1.19 export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")"
186 leonardop 1.1
187     einfo "Uninstalling GNOME 2 GConf schemas"
188    
189 eva 1.17 local F
190 remi 1.8 for F in ${GNOME2_ECLASS_SCHEMAS}; do
191 eva 1.18 if [[ -e "${EROOT}${F}" ]]; then
192 eva 1.17 debug-print "Uninstalling gconf schema: ${F}"
193 eva 1.18 "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null
194 remi 1.8 fi
195     done
196    
197     # have gconf reload the new schemas
198     pids=$(pgrep -x gconfd-2)
199     if [[ $? == 0 ]] ; then
200     ebegin "Reloading GConf schemas"
201     kill -HUP ${pids}
202     eend $?
203     fi
204     }
205    
206 eva 1.22 # @FUNCTION: gnome2_icon_savelist
207     # @DESCRIPTION:
208 remi 1.8 # Find the icons that are about to be installed and save their location
209 eva 1.22 # in the GNOME2_ECLASS_ICONS environment variable.
210     # This function should be called from pkg_preinst.
211 remi 1.9 gnome2_icon_savelist() {
212 eva 1.18 has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
213     pushd "${ED}" &> /dev/null
214 remi 1.10 export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
215 remi 1.8 popd &> /dev/null
216 leonardop 1.1 }
217    
218 eva 1.22 # @FUNCTION: gnome2_icon_cache_update
219     # @DESCRIPTION:
220 leonardop 1.1 # Updates Gtk+ icon cache files under /usr/share/icons if the current ebuild
221     # have installed anything under that location.
222 eva 1.22 # This function should be called from pkg_postinst and pkg_postrm.
223 leonardop 1.1 gnome2_icon_cache_update() {
224 eva 1.18 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
225     local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
226 leonardop 1.1
227 remi 1.8 if [[ ! -x "${updater}" ]] ; then
228 leonardop 1.1 debug-print "${updater} is not executable"
229 remi 1.8 return
230     fi
231 leonardop 1.1
232 remi 1.8 if [[ -z "${GNOME2_ECLASS_ICONS}" ]]; then
233 eva 1.17 debug-print "No icon cache to update"
234 leonardop 1.1 return
235     fi
236    
237     ebegin "Updating icons cache"
238    
239     local retval=0
240     local fails=( )
241    
242 remi 1.8 for dir in ${GNOME2_ECLASS_ICONS}
243 leonardop 1.1 do
244 abcd 1.20 if [[ -f "${EROOT}${dir}/index.theme" ]] ; then
245 leonardop 1.1 local rv=0
246    
247 eva 1.18 "${updater}" -qf "${EROOT}${dir}"
248 leonardop 1.1 rv=$?
249    
250     if [[ ! $rv -eq 0 ]] ; then
251 eva 1.18 debug-print "Updating cache failed on ${EROOT}${dir}"
252 leonardop 1.1
253     # Add to the list of failures
254 eva 1.18 fails[$(( ${#fails[@]} + 1 ))]="${EROOT}${dir}"
255 leonardop 1.1
256     retval=2
257     fi
258 tetromino 1.26 elif [[ $(ls "${EROOT}${dir}") = "icon-theme.cache" ]]; then
259     # Clear stale cache files after theme uninstallation
260     rm "${EROOT}${dir}/icon-theme.cache"
261     fi
262    
263     if [[ -z $(ls "${EROOT}${dir}") ]]; then
264     # Clear empty theme directories after theme uninstallation
265     rmdir "${EROOT}${dir}"
266 leonardop 1.1 fi
267     done
268    
269     eend ${retval}
270    
271 remi 1.8 for f in "${fails[@]}" ; do
272     eerror "Failed to update cache with icon $f"
273 leonardop 1.1 done
274     }
275    
276 eva 1.22 # @FUNCTION: gnome2_omf_fix
277     # @DESCRIPTION:
278 leonardop 1.1 # Workaround applied to Makefile rules in order to remove redundant
279     # calls to scrollkeeper-update and sandbox violations.
280 eva 1.22 # This function should be called from src_prepare.
281 leonardop 1.1 gnome2_omf_fix() {
282     local omf_makefiles filename
283    
284     omf_makefiles="$@"
285    
286     if [[ -f ${S}/omf.make ]] ; then
287     omf_makefiles="${omf_makefiles} ${S}/omf.make"
288     fi
289    
290 eva 1.27 if [[ -f ${S}/gnome-doc-utils.make ]] ; then
291     omf_makefiles="${omf_makefiles} ${S}/gnome-doc-utils.make"
292     fi
293    
294 leonardop 1.1 # testing fixing of all makefiles found
295 leio 1.11 # The sort is important to ensure .am is listed before the respective .in for
296     # maintainer mode regeneration not kicking in due to .am being newer than .in
297 eva 1.27 for filename in $(find "${S}" -name "Makefile.in" -o -name "Makefile.am" |sort) ; do
298 leonardop 1.1 omf_makefiles="${omf_makefiles} ${filename}"
299     done
300    
301     ebegin "Fixing OMF Makefiles"
302    
303     local retval=0
304     local fails=( )
305    
306     for omf in ${omf_makefiles} ; do
307 remi 1.8 sed -i -e 's:scrollkeeper-update:true:' "${omf}"
308 leonardop 1.1 retval=$?
309    
310 eva 1.27 if [[ $retval -ne 0 ]] ; then
311 leonardop 1.1 debug-print "updating of ${omf} failed"
312    
313     # Add to the list of failures
314     fails[$(( ${#fails[@]} + 1 ))]=$omf
315    
316     retval=2
317     fi
318     done
319    
320     eend $retval
321    
322 remi 1.10 for f in "${fails[@]}" ; do
323     eerror "Failed to update OMF Makefile $f"
324 leonardop 1.1 done
325     }
326    
327 eva 1.27 # @FUNCTION: gnome2_scrollkeeper_savelist
328     # @DESCRIPTION:
329     # Find the scrolls that are about to be installed and save their location
330     # in the GNOME2_ECLASS_SCROLLS environment variable.
331     # This function should be called from pkg_preinst.
332     gnome2_scrollkeeper_savelist() {
333     has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
334     pushd "${ED}" &> /dev/null
335     export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name "*.omf" 2> /dev/null)
336     popd &> /dev/null
337     }
338    
339 eva 1.22 # @FUNCTION: gnome2_scrollkeeper_update
340     # @DESCRIPTION:
341 leonardop 1.1 # Updates the global scrollkeeper database.
342 eva 1.22 # This function should be called from pkg_postinst and pkg_postrm.
343 leonardop 1.1 gnome2_scrollkeeper_update() {
344 eva 1.18 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
345 eva 1.27 local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
346    
347     if [[ ! -x "${updater}" ]] ; then
348     debug-print "${updater} is not executable"
349     return
350     fi
351    
352     if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then
353     debug-print "No scroll cache to update"
354     return
355 leonardop 1.1 fi
356 eva 1.27
357     ebegin "Updating scrollkeeper database ..."
358     "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
359     eend $?
360 leonardop 1.1 }
361 eva 1.14
362 eva 1.22 # @FUNCTION: gnome2_schemas_savelist
363     # @DESCRIPTION:
364     # Find if there is any GSettings schema to install and save the list in
365     # GNOME2_ECLASS_GLIB_SCHEMAS variable.
366     # This function should be called from pkg_preinst.
367 eva 1.14 gnome2_schemas_savelist() {
368 eva 1.18 has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
369     pushd "${ED}" &>/dev/null
370 eva 1.14 export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' -name '*.gschema.xml' 2>/dev/null)
371     popd &>/dev/null
372     }
373    
374 eva 1.22 # @FUNCTION: gnome2_schemas_update
375 tetromino 1.25 # @USAGE: gnome2_schemas_update
376 eva 1.22 # @DESCRIPTION:
377     # Updates GSettings schemas if GNOME2_ECLASS_GLIB_SCHEMAS has some.
378 tetromino 1.25 # This function should be called from pkg_postinst and pkg_postrm.
379 eva 1.14 gnome2_schemas_update() {
380 eva 1.18 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
381     local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
382 eva 1.14
383     if [[ ! -x ${updater} ]]; then
384     debug-print "${updater} is not executable"
385     return
386     fi
387    
388     if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
389 eva 1.17 debug-print "No GSettings schemas to update"
390 eva 1.14 return
391     fi
392    
393     ebegin "Updating GSettings schemas"
394 eva 1.18 ${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null
395 eva 1.14 eend $?
396     }
397 naota 1.28
398 eva 1.32 # @FUNCTION: gnome2_gdk_pixbuf_savelist
399     # @DESCRIPTION:
400     # Find if there is any gdk-pixbuf loader to install and save the list in
401     # GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
402     # This function should be called from pkg_preinst.
403     gnome2_gdk_pixbuf_savelist() {
404     has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
405     pushd "${ED}" 1>/dev/null
406 mgorny 1.36 export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find usr/lib*/gdk-pixbuf-2.0 -type f 2>/dev/null)
407 eva 1.32 popd 1>/dev/null
408     }
409    
410     # @FUNCTION: gnome2_gdk_pixbuf_update
411     # @USAGE: gnome2_gdk_pixbuf_update
412     # @DESCRIPTION:
413     # Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
414     # This function should be called from pkg_postinst and pkg_postrm.
415     gnome2_gdk_pixbuf_update() {
416     has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
417 mgorny 1.36 local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
418    
419     if [[ ! -x ${updater} ]]; then
420     updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
421     fi
422 eva 1.32
423     if [[ ! -x ${updater} ]]; then
424     debug-print "${updater} is not executable"
425     return
426     fi
427    
428     if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
429     debug-print "gdk-pixbuf loader cache does not need an update"
430     return
431     fi
432    
433     ebegin "Updating gdk-pixbuf loader cache"
434     local tmp_file=$(mktemp -t tmp.XXXXXXXXXX_gdkpixbuf)
435     ${updater} 1> "${tmp_file}" &&
436     chmod 0644 "${tmp_file}" &&
437 pacho 1.35 cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
438     rm "${tmp_file}" # don't replace this with mv, required for SELinux support
439 eva 1.32 eend $?
440     }
441    
442    
443 naota 1.28 # @FUNCTION: gnome2_query_immodules_gtk2
444     # @USAGE: gnome2_query_immodules_gtk2
445     # @DESCRIPTION:
446     # Updates gtk2 immodules/gdk-pixbuf loaders listing.
447     gnome2_query_immodules_gtk2() {
448 pacho 1.33 if has_version ">=x11-libs/gtk+-2.24.20:2"; then
449     "${EPREFIX}/usr/bin/gtk-query-immodules-2.0" --update-cache
450     else
451     local GTK2_CONFDIR="/etc/gtk-2.0/$(get_abi_CHOST)"
452 naota 1.28
453 pacho 1.33 local query_exec="${EPREFIX}/usr/bin/gtk-query-immodules-2.0"
454     local gtk_conf="${EPREFIX}${GTK2_CONFDIR}/gtk.immodules"
455     local gtk_conf_dir=$(dirname "${gtk_conf}")
456    
457     einfo "Generating Gtk2 immodules/gdk-pixbuf loaders listing:"
458     einfo "-> ${gtk_conf}"
459    
460     mkdir -p "${gtk_conf_dir}"
461     local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules)
462     if [ -z "${tmp_file}" ]; then
463     ewarn "gtk_query_immodules: cannot create temporary file"
464     return 1
465     fi
466 naota 1.28
467 pacho 1.33 if ${query_exec} > "${tmp_file}"; then
468     cat "${tmp_file}" > "${gtk_conf}" || \
469     ewarn "Failed to write to ${gtk_conf}"
470     else
471     ewarn "Cannot update gtk.immodules, file generation failed"
472     fi
473     rm "${tmp_file}"
474 naota 1.28 fi
475     }
476    
477     # @FUNCTION: gnome2_query_immodules_gtk3
478     # @USAGE: gnome2_query_immodules_gtk3
479     # @DESCRIPTION:
480     # Updates gtk3 immodules/gdk-pixbuf loaders listing.
481     gnome2_query_immodules_gtk3() {
482     "${EPREFIX}/usr/bin/gtk-query-immodules-3.0" --update-cache
483     }
484 eva 1.30
485     # @FUNCTION: gnome2_disable_deprecation_warning
486     # @DESCRIPTION:
487     # Disable deprecation warnings commonly found in glib based packages.
488     # Should be called from src_prepare.
489     gnome2_disable_deprecation_warning() {
490     local retval=0
491     local fails=( )
492     local makefile
493    
494     ebegin "Disabling deprecation warnings"
495     # The sort is important to ensure .am is listed before the respective .in for
496     # maintainer mode regeneration not kicking in due to .am being newer than .in
497     while read makefile ; do
498     if ! grep -qE "(DISABLE_DEPRECATED|GSEAL_ENABLE)" "${makefile}"; then
499     continue
500     fi
501    
502     LC_ALL=C sed -r -i \
503     -e 's:-D[A-Z_]+_DISABLE_DEPRECATED:$(NULL):g' \
504 pacho 1.34 -e 's:-DGSEAL_ENABLE+[A-Z_]:$(NULL):g' \
505 eva 1.30 -i "${makefile}"
506    
507     if [[ $? -ne 0 ]]; then
508     # Add to the list of failures
509     fails+=( "${makefile}" )
510     retval=2
511     fi
512     done < <(find "${S}" -name "Makefile.in" \
513     -o -name "Makefile.am" -o -name "Makefile.decl" \
514     | sort; echo configure)
515 tetromino 1.31 # TODO: sedding configure.ac can trigger maintainer mode; bug #439602
516     # -o -name "configure.ac" -o -name "configure.in" \
517     # | sort; echo configure)
518 eva 1.30 eend ${retval}
519    
520     for makefile in "${fails[@]}" ; do
521     ewarn "Failed to disable deprecation warnings in ${makefile}"
522     done
523     }

  ViewVC Help
Powered by ViewVC 1.1.20