1 |
abcd 10/02/26 03:15:27 |
2 |
|
3 |
Modified: eutils.eclass |
4 |
Log: |
5 |
Properly implement the Desktop File Specification in make_desktop_entry() |
6 |
|
7 |
Revision Changes Path |
8 |
1.334 eclass/eutils.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/eutils.eclass?rev=1.334&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/eutils.eclass?rev=1.334&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/eutils.eclass?r1=1.333&r2=1.334 |
13 |
|
14 |
Index: eutils.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v |
17 |
retrieving revision 1.333 |
18 |
retrieving revision 1.334 |
19 |
diff -u -r1.333 -r1.334 |
20 |
--- eutils.eclass 17 Feb 2010 17:10:23 -0000 1.333 |
21 |
+++ eutils.eclass 26 Feb 2010 03:15:26 -0000 1.334 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2009 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.333 2010/02/17 17:10:23 betelgeuse Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.334 2010/02/26 03:15:26 abcd Exp $ |
27 |
|
28 |
# @ECLASS: eutils.eclass |
29 |
# @MAINTAINER: |
30 |
@@ -961,6 +961,7 @@ |
31 |
news) type=News;; |
32 |
nntp) type=News;; |
33 |
p2p) type=FileTransfer;; |
34 |
+ voip) type=Telephony;; |
35 |
*) type=;; |
36 |
esac |
37 |
type="Network;${type}" |
38 |
@@ -979,7 +980,7 @@ |
39 |
visual*) type=DataVisualization;; |
40 |
*) type=;; |
41 |
esac |
42 |
- type="Science;${type}" |
43 |
+ type="Education;Science;${type}" |
44 |
;; |
45 |
|
46 |
sys) |
47 |
@@ -991,7 +992,7 @@ |
48 |
client) type=WebBrowser;; |
49 |
*) type=;; |
50 |
esac |
51 |
- type="Network" |
52 |
+ type="Network;${type}" |
53 |
;; |
54 |
|
55 |
*) |
56 |
@@ -1007,6 +1008,17 @@ |
57 |
local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" |
58 |
#local desktop=${T}/${exec%% *:-${desktop_name}}.desktop |
59 |
|
60 |
+ # Don't append another ";" when a valid category value is provided. |
61 |
+ type=${type%;}${type:+;} |
62 |
+ |
63 |
+ eshopts_push -s extglob |
64 |
+ if [[ -n ${icon} && ${icon} != /* && ${icon} == *.@(xpm|png|svg) ]]; then |
65 |
+ ewarn "As described in the Icon Theme Specification, icon file extensions are not" |
66 |
+ ewarn "allowed in .desktop files if the value is not an absolute path." |
67 |
+ icon=${icon%.@(xpm|png|svg)} |
68 |
+ fi |
69 |
+ eshopts_pop |
70 |
+ |
71 |
cat <<-EOF > "${desktop}" |
72 |
[Desktop Entry] |
73 |
Name=${name} |
74 |
@@ -1015,7 +1027,7 @@ |
75 |
Exec=${exec} |
76 |
TryExec=${exec%% *} |
77 |
Icon=${icon} |
78 |
- Categories=${type}; |
79 |
+ Categories=${type} |
80 |
EOF |
81 |
|
82 |
[[ ${path} ]] && echo "Path=${path}" >> "${desktop}" |