diff options
author | Carsten Lohrke <carlo@gentoo.org> | 2007-04-06 11:43:30 +0000 |
---|---|---|
committer | Carsten Lohrke <carlo@gentoo.org> | 2007-04-06 11:43:30 +0000 |
commit | c9706a6320f8dac7668405838e39e905107b2203 (patch) | |
tree | fb5a49e7e275f0798421a909e2359afd9abf4330 /eclass | |
parent | stable x86, bug 173040 (diff) | |
download | gentoo-2-c9706a6320f8dac7668405838e39e905107b2203.tar.gz gentoo-2-c9706a6320f8dac7668405838e39e905107b2203.tar.bz2 gentoo-2-c9706a6320f8dac7668405838e39e905107b2203.zip |
add validate_desktop_entries()
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/eutils.eclass | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 3a7ee91bf384..905463931d6c 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.276 2007/02/18 03:11:46 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.277 2007/04/06 11:43:30 carlo Exp $ # # This eclass is for general purpose functions that most ebuilds # have to implement themselves. @@ -919,6 +919,32 @@ make_desktop_entry() { ) } + +# Validatedesktop entries using desktop-file-utils +# Carsten Lohrke <carlo@gentoo.org> +# +# Usage: validate_desktop_entries [directory ...] + +validate_desktop_entries() { + if [[ -x /usr/bin/desktop-file-validate ]] ; then + einfo "Checking desktop entry validity" + local directories="" + for d in $@ ; do + directories="${directories} ${D}${d}" + done + for FILE in $(find ${D}/usr/share/applications ${directories} -name "*\.desktop" \ + -not -path '*.hidden*' 2>/dev/null) + do + local temp=$(desktop-file-validate ${FILE} | grep -v "warning:") + [[ -n $temp ]] && elog ${temp//${D}/} + done + echo "" + else + einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo." + fi +} + + # Make a GDM/KDM Session file # # make_session_desktop(<title>, <command>) |