From: Carsten Lohrke Date: Thu, 19 Apr 2007 10:24:56 +0000 (+0000) Subject: Move desktop entry handling to kde-functions.eclass and don't bother about applnk... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d7558ef2e466f6004679ac6aae4a4ecf62ea498e;p=gentoo.git Move desktop entry handling to kde-functions.eclass and don't bother about applnk paths. --- diff --git a/eclass/kde-functions.eclass b/eclass/kde-functions.eclass index e3e327a9dd06..d83e38ce8da1 100644 --- a/eclass/kde-functions.eclass +++ b/eclass/kde-functions.eclass @@ -1,13 +1,13 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.147 2007/04/12 14:01:42 carlo Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.148 2007/04/19 10:24:56 carlo Exp $ # # Author Dan Armak # # This contains everything except things that modify ebuild variables # and functions (e.g. $P, src_compile() etc.) -inherit qt3 +inherit qt3 eutils # map of the monolithic->split ebuild derivation; used to build deps describing # the relationships between them @@ -891,6 +891,9 @@ kde_remove_flag() { } buildsycoca() { + [[ $EBUILD_PHASE != postinst ]] && [[ $EBUILD_PHASE != postrm ]] && \ + die "buildsycoca() has to be calles in pkg_postinst() and pkg_postrm()." + if [[ -x ${KDEDIR}/bin/kbuildsycoca ]] && [[ -z ${ROOT} || ${ROOT} == "/" ]] && has "~${ARCH}" "${ACCEPT_KEYWORDS}"; then # First of all, make sure that the /usr/share/services directory exists # and it has the right permissions @@ -904,6 +907,22 @@ buildsycoca() { fi } +postprocess_desktop_entries() { + [[ $EBUILD_PHASE != preinst ]] && [[ $EBUILD_PHASE != install ]] && \ + die "postprocess_desktop_entries() has to be called in src_install() or pkg_preinst()." + + local desktop_entries="$(find "${D}${PREFIX}/share/applnk" -name '*.desktop' \ + -not -path '*.hidden*' 2>/dev/null)" + if [[ -n ${desktop_entries} ]]; then + for entry in ${desktop_entries} ; do + dodir ${PREFIX}/share/applications/kde + mv ${entry} ${D}${PREFIX}/share/applications/kde + done + fi + + validate_desktop_entries ${PREFIX}/share/applications +} + # is this a kde-base ebuid? if [ "${CATEGORY}" == "kde-base" ]; then debug-print "${ECLASS}: KDEBASE ebuild recognized" diff --git a/eclass/kde.eclass b/eclass/kde.eclass index 4407c878902f..ca47e5a43e38 100644 --- a/eclass/kde.eclass +++ b/eclass/kde.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.195 2007/04/11 17:56:18 carlo Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.196 2007/04/19 10:24:56 carlo Exp $ # # Author Dan Armak # @@ -446,13 +446,7 @@ slot_rebuild() { } kde_pkg_preinst() { - validate_desktop_entries ${PREFIX}/share/appl{nk,ications} - if [[ $(find "${D}${PREFIX}/share/applnk" -name '*.desktop' \ - -not -path '*.hidden*' 2>/dev/null | wc -l) != "0" ]]; then - ewarn "This ebuild is installing .desktop files in the deprecated path" - ewarn "${PREFIX}/share/applnk/. They will only be visible within KDE." - echo "" - fi + postprocess_desktop_entries } kde_pkg_postinst() {