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

Diff of /eclass/eutils.eclass

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

Revision 1.277 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.277 2007/04/06 11:43:30 carlo 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!
918 doins "${desktop}" 918 doins "${desktop}"
919 ) 919 )
920} 920}
921 921
922 922
923# Validatedesktop entries using desktop-file-utils 923# Validate desktop entries using desktop-file-utils
924# Carsten Lohrke <carlo@gentoo.org> 924# Carsten Lohrke <carlo@gentoo.org>
925# 925#
926# Usage: validate_desktop_entries [directory ...] 926# Usage: validate_desktop_entries [directory ...]
927 927
928validate_desktop_entries() { 928validate_desktop_entries() {
929 if [[ -x /usr/bin/desktop-file-validate ]] ; then 929 if [[ -x /usr/bin/desktop-file-validate ]] ; then
930 einfo "Checking desktop entry validity" 930 einfo "Checking desktop entry validity"
931 local directories="" 931 local directories=""
932 for d in $@ ; do 932 for d in /usr/share/applications $@ ; do
933 directories="${directories} ${D}${d}" 933 [[ -d ${D}${d} ]] && directories="${directories} ${D}${d}"
934 done 934 done
935 if [[ -n ${directories} ]] ; then
935 for FILE in $(find ${D}/usr/share/applications ${directories} -name "*\.desktop" \ 936 for FILE in $(find ${directories} -name "*\.desktop" \
936 -not -path '*.hidden*' 2>/dev/null) 937 -not -path '*.hidden*' | sort -u 2>/dev/null)
937 do 938 do
938 local temp=$(desktop-file-validate ${FILE} | grep -v "warning:") 939 local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | \
940 sed -e "s|error: ||" -e "s|${FILE}:|--|g" )
939 [[ -n $temp ]] && elog ${temp//${D}/} 941 [[ -n $temp ]] && elog ${temp/--/${FILE/${D}/}:}
940 done 942 done
943 fi
941 echo "" 944 echo ""
942 else 945 else
943 einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo." 946 einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo."
944 fi 947 fi
945} 948}

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

  ViewVC Help
Powered by ViewVC 1.1.20