/[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.278
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.278 2007/04/22 15:55:07 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 $@ ; do
933 directories="${directories} ${D}${d}"
934 done
935 for FILE in $(find ${D}/usr/share/applications ${directories} -name "*\.desktop" \
936 -not -path '*.hidden*' | sort -u 2>/dev/null)
937 do
938 local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | \
939 sed -e "s|error: ||" -e "s|${FILE}:|--|g" )
940 [[ -n $temp ]] && elog ${temp/--/${FILE/${D}/}:}
941 done
942 echo ""
943 else
944 einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo."
945 fi
946}
947
921 948
922# Make a GDM/KDM Session file 949# Make a GDM/KDM Session file
923# 950#
924# make_session_desktop(<title>, <command>) 951# make_session_desktop(<title>, <command>)
925# title: File to execute to start the Window Manager 952# title: File to execute to start the Window Manager
1581# } 1608# }
1582 1609
1583preserve_old_lib() { 1610preserve_old_lib() {
1584 if [[ ${EBUILD_PHASE} != "preinst" ]] ; then 1611 if [[ ${EBUILD_PHASE} != "preinst" ]] ; then
1585 eerror "preserve_old_lib() must be called from pkg_preinst() only" 1612 eerror "preserve_old_lib() must be called from pkg_preinst() only"
1586# die "Invalid preserve_old_lib() usage" 1613 die "Invalid preserve_old_lib() usage"
1587 fi 1614 fi
1588 [[ -z $1 ]] && die "Usage: preserve_old_lib <library to preserve> [more libraries to preserve]" 1615 [[ -z $1 ]] && die "Usage: preserve_old_lib <library to preserve> [more libraries to preserve]"
1589 1616
1590 local lib dir 1617 local lib dir
1591 for lib in "$@" ; do 1618 for lib in "$@" ; do
1598} 1625}
1599 1626
1600preserve_old_lib_notify() { 1627preserve_old_lib_notify() {
1601 if [[ ${EBUILD_PHASE} != "postinst" ]] ; then 1628 if [[ ${EBUILD_PHASE} != "postinst" ]] ; then
1602 eerror "preserve_old_lib_notify() must be called from pkg_postinst() only" 1629 eerror "preserve_old_lib_notify() must be called from pkg_postinst() only"
1603# die "Invalid preserve_old_lib_notify() usage" 1630 die "Invalid preserve_old_lib_notify() usage"
1604 fi 1631 fi
1605 1632
1606 local lib notice=0 1633 local lib notice=0
1607 for lib in "$@" ; do 1634 for lib in "$@" ; do
1608 [[ -e ${ROOT}/${lib} ]] || continue 1635 [[ -e ${ROOT}/${lib} ]] || continue

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

  ViewVC Help
Powered by ViewVC 1.1.20