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

Diff of /eclass/eutils.eclass

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

Revision 1.334 Revision 1.335
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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.334 2010/02/26 03:15:26 abcd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.335 2010/02/26 05:17:24 halcy0n Exp $
4 4
5# @ECLASS: eutils.eclass 5# @ECLASS: eutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: many extra (but common) functions that are used in ebuilds 8# @BLURB: many extra (but common) functions that are used in ebuilds
959 irc) type=IRCClient;; 959 irc) type=IRCClient;;
960 mail) type=Email;; 960 mail) type=Email;;
961 news) type=News;; 961 news) type=News;;
962 nntp) type=News;; 962 nntp) type=News;;
963 p2p) type=FileTransfer;; 963 p2p) type=FileTransfer;;
964 voip) type=Telephony;;
965 *) type=;; 964 *) type=;;
966 esac 965 esac
967 type="Network;${type}" 966 type="Network;${type}"
968 ;; 967 ;;
969 968
978 math*) type=Math;; 977 math*) type=Math;;
979 physics) type=Physics;; 978 physics) type=Physics;;
980 visual*) type=DataVisualization;; 979 visual*) type=DataVisualization;;
981 *) type=;; 980 *) type=;;
982 esac 981 esac
983 type="Education;Science;${type}" 982 type="Science;${type}"
984 ;; 983 ;;
985 984
986 sys) 985 sys)
987 type="System" 986 type="System"
988 ;; 987 ;;
990 www) 989 www)
991 case ${catmin} in 990 case ${catmin} in
992 client) type=WebBrowser;; 991 client) type=WebBrowser;;
993 *) type=;; 992 *) type=;;
994 esac 993 esac
995 type="Network;${type}" 994 type="Network"
996 ;; 995 ;;
997 996
998 *) 997 *)
999 type= 998 type=
1000 ;; 999 ;;
1005 else 1004 else
1006 local desktop_name="${PN}-${SLOT}" 1005 local desktop_name="${PN}-${SLOT}"
1007 fi 1006 fi
1008 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" 1007 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
1009 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop 1008 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
1010
1011 # Don't append another ";" when a valid category value is provided.
1012 type=${type%;}${type:+;}
1013
1014 eshopts_push -s extglob
1015 if [[ -n ${icon} && ${icon} != /* && ${icon} == *.@(xpm|png|svg) ]]; then
1016 ewarn "As described in the Icon Theme Specification, icon file extensions are not"
1017 ewarn "allowed in .desktop files if the value is not an absolute path."
1018 icon=${icon%.@(xpm|png|svg)}
1019 fi
1020 eshopts_pop
1021 1009
1022 cat <<-EOF > "${desktop}" 1010 cat <<-EOF > "${desktop}"
1023 [Desktop Entry] 1011 [Desktop Entry]
1024 Name=${name} 1012 Name=${name}
1025 Type=Application 1013 Type=Application
1026 Comment=${DESCRIPTION} 1014 Comment=${DESCRIPTION}
1027 Exec=${exec} 1015 Exec=${exec}
1028 TryExec=${exec%% *} 1016 TryExec=${exec%% *}
1029 Icon=${icon} 1017 Icon=${icon}
1030 Categories=${type} 1018 Categories=${type};
1031 EOF 1019 EOF
1032 1020
1033 [[ ${path} ]] && echo "Path=${path}" >> "${desktop}" 1021 [[ ${path} ]] && echo "Path=${path}" >> "${desktop}"
1034 1022
1035 ( 1023 (

Legend:
Removed from v.1.334  
changed lines
  Added in v.1.335

  ViewVC Help
Powered by ViewVC 1.1.20