From: Jonathan Callen Date: Fri, 26 Feb 2010 03:15:26 +0000 (+0000) Subject: Properly implement the Desktop File Specification in make_desktop_entry() X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8537ce05bbbdd08c23eb15fcb5eb3b6c4d64f15c;p=gentoo.git Properly implement the Desktop File Specification in make_desktop_entry() --- diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 17893be10e58..d8b753e4b906 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.333 2010/02/17 17:10:23 betelgeuse Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.334 2010/02/26 03:15:26 abcd Exp $ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -961,6 +961,7 @@ make_desktop_entry() { news) type=News;; nntp) type=News;; p2p) type=FileTransfer;; + voip) type=Telephony;; *) type=;; esac type="Network;${type}" @@ -979,7 +980,7 @@ make_desktop_entry() { visual*) type=DataVisualization;; *) type=;; esac - type="Science;${type}" + type="Education;Science;${type}" ;; sys) @@ -991,7 +992,7 @@ make_desktop_entry() { client) type=WebBrowser;; *) type=;; esac - type="Network" + type="Network;${type}" ;; *) @@ -1007,6 +1008,17 @@ make_desktop_entry() { local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop + # Don't append another ";" when a valid category value is provided. + type=${type%;}${type:+;} + + eshopts_push -s extglob + if [[ -n ${icon} && ${icon} != /* && ${icon} == *.@(xpm|png|svg) ]]; then + ewarn "As described in the Icon Theme Specification, icon file extensions are not" + ewarn "allowed in .desktop files if the value is not an absolute path." + icon=${icon%.@(xpm|png|svg)} + fi + eshopts_pop + cat <<-EOF > "${desktop}" [Desktop Entry] Name=${name} @@ -1015,7 +1027,7 @@ make_desktop_entry() { Exec=${exec} TryExec=${exec%% *} Icon=${icon} - Categories=${type}; + Categories=${type} EOF [[ ${path} ]] && echo "Path=${path}" >> "${desktop}"