/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

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

Revision 1.275 Revision 1.279
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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/eutils.eclass,v 1.275 2007/02/17 00:17:39 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.279 2007/04/25 09:14:35 carlo Exp $
4# 4#
5# This eclass is for general purpose functions that most ebuilds 5# This eclass is for general purpose functions that most ebuilds
6# have to implement themselves. 6# have to implement themselves.
7# 7#
8# NB: If you add anything, please comment it! 8# NB: If you add anything, please comment it!
916 # doesn't corrupt the env of the caller 916 # doesn't corrupt the env of the caller
917 insinto /usr/share/applications 917 insinto /usr/share/applications
918 doins "${desktop}" 918 doins "${desktop}"
919 ) 919 )
920} 920}
921
922
923# Validate desktop entries using desktop-file-utils
924# Carsten Lohrke <carlo@gentoo.org>
925#
926# Usage: validate_desktop_entries [directory ...]
927
928validate_desktop_entries() {
929 if [[ -x /usr/bin/desktop-file-validate ]] ; then
930 einfo "Checking desktop entry validity"
931 local directories=""
932 for d in /usr/share/applications $@ ; do
933 [[ -d ${D}${d} ]] && directories="${directories} ${D}${d}"
934 done
935 if [[ -n ${directories} ]] ; then
936 for FILE in $(find ${directories} -name "*\.desktop" \
937 -not -path '*.hidden*' | sort -u 2>/dev/null)
938 do
939 local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | \
940 sed -e "s|error: ||" -e "s|${FILE}:|--|g" )
941 [[ -n $temp ]] && elog ${temp/--/${FILE/${D}/}:}
942 done
943 fi
944 echo ""
945 else
946 einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo."
947 fi
948}
949
921 950
922# Make a GDM/KDM Session file 951# Make a GDM/KDM Session file
923# 952#
924# make_session_desktop(<title>, <command>) 953# make_session_desktop(<title>, <command>)
925# title: File to execute to start the Window Manager 954# title: File to execute to start the Window Manager
1581# } 1610# }
1582 1611
1583preserve_old_lib() { 1612preserve_old_lib() {
1584 if [[ ${EBUILD_PHASE} != "preinst" ]] ; then 1613 if [[ ${EBUILD_PHASE} != "preinst" ]] ; then
1585 eerror "preserve_old_lib() must be called from pkg_preinst() only" 1614 eerror "preserve_old_lib() must be called from pkg_preinst() only"
1586# die "Invalid preserve_old_lib() usage" 1615 die "Invalid preserve_old_lib() usage"
1587 fi 1616 fi
1588 [[ -z $1 ]] && die "Usage: preserve_old_lib <library to preserve> [more libraries to preserve]" 1617 [[ -z $1 ]] && die "Usage: preserve_old_lib <library to preserve> [more libraries to preserve]"
1589 1618
1590 local lib dir 1619 local lib dir
1591 for lib in "$@" ; do 1620 for lib in "$@" ; do
1598} 1627}
1599 1628
1600preserve_old_lib_notify() { 1629preserve_old_lib_notify() {
1601 if [[ ${EBUILD_PHASE} != "postinst" ]] ; then 1630 if [[ ${EBUILD_PHASE} != "postinst" ]] ; then
1602 eerror "preserve_old_lib_notify() must be called from pkg_postinst() only" 1631 eerror "preserve_old_lib_notify() must be called from pkg_postinst() only"
1603# die "Invalid preserve_old_lib_notify() usage" 1632 die "Invalid preserve_old_lib_notify() usage"
1604 fi 1633 fi
1605 1634
1606 local lib notice=0 1635 local lib notice=0
1607 for lib in "$@" ; do 1636 for lib in "$@" ; do
1608 [[ -e ${ROOT}/${lib} ]] || continue 1637 [[ -e ${ROOT}/${lib} ]] || continue

Legend:
Removed from v.1.275  
changed lines
  Added in v.1.279

  ViewVC Help
Powered by ViewVC 1.1.20