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

Diff of /eclass/gnome2-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.32 Revision 1.33
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.32 2013/09/03 21:54:38 eva Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.33 2013/09/15 19:29:11 pacho Exp $
4 4
5# @ECLASS: gnome2-utils.eclass 5# @ECLASS: gnome2-utils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# gnome@gentoo.org 7# gnome@gentoo.org
8# @BLURB: Auxiliary functions commonly used by Gnome packages. 8# @BLURB: Auxiliary functions commonly used by Gnome packages.
444# @FUNCTION: gnome2_query_immodules_gtk2 444# @FUNCTION: gnome2_query_immodules_gtk2
445# @USAGE: gnome2_query_immodules_gtk2 445# @USAGE: gnome2_query_immodules_gtk2
446# @DESCRIPTION: 446# @DESCRIPTION:
447# Updates gtk2 immodules/gdk-pixbuf loaders listing. 447# Updates gtk2 immodules/gdk-pixbuf loaders listing.
448gnome2_query_immodules_gtk2() { 448gnome2_query_immodules_gtk2() {
449 local GTK2_CONFDIR="/etc/gtk-2.0/$(get_abi_CHOST)" 449 if has_version ">=x11-libs/gtk+-2.24.20:2"; then
450 450 "${EPREFIX}/usr/bin/gtk-query-immodules-2.0" --update-cache
451 local query_exec="${EPREFIX}/usr/bin/gtk-query-immodules-2.0"
452 local gtk_conf="${EPREFIX}${GTK2_CONFDIR}/gtk.immodules"
453 local gtk_conf_dir=$(dirname "${gtk_conf}")
454
455 einfo "Generating Gtk2 immodules/gdk-pixbuf loaders listing:"
456 einfo "-> ${gtk_conf}"
457
458 mkdir -p "${gtk_conf_dir}"
459 local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules)
460 if [ -z "${tmp_file}" ]; then
461 ewarn "gtk_query_immodules: cannot create temporary file"
462 return 1
463 fi
464
465 if ${query_exec} > "${tmp_file}"; then
466 cat "${tmp_file}" > "${gtk_conf}" || \
467 ewarn "Failed to write to ${gtk_conf}"
468 else 451 else
452 local GTK2_CONFDIR="/etc/gtk-2.0/$(get_abi_CHOST)"
453
454 local query_exec="${EPREFIX}/usr/bin/gtk-query-immodules-2.0"
455 local gtk_conf="${EPREFIX}${GTK2_CONFDIR}/gtk.immodules"
456 local gtk_conf_dir=$(dirname "${gtk_conf}")
457
458 einfo "Generating Gtk2 immodules/gdk-pixbuf loaders listing:"
459 einfo "-> ${gtk_conf}"
460
461 mkdir -p "${gtk_conf_dir}"
462 local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules)
463 if [ -z "${tmp_file}" ]; then
464 ewarn "gtk_query_immodules: cannot create temporary file"
465 return 1
466 fi
467
468 if ${query_exec} > "${tmp_file}"; then
469 cat "${tmp_file}" > "${gtk_conf}" || \
470 ewarn "Failed to write to ${gtk_conf}"
471 else
469 ewarn "Cannot update gtk.immodules, file generation failed" 472 ewarn "Cannot update gtk.immodules, file generation failed"
470 fi 473 fi
471 rm "${tmp_file}" 474 rm "${tmp_file}"
475 fi
472} 476}
473 477
474# @FUNCTION: gnome2_query_immodules_gtk3 478# @FUNCTION: gnome2_query_immodules_gtk3
475# @USAGE: gnome2_query_immodules_gtk3 479# @USAGE: gnome2_query_immodules_gtk3
476# @DESCRIPTION: 480# @DESCRIPTION:

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.20