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

Diff of /eclass/eutils.eclass

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

Revision 1.292 Revision 1.293
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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.292 2007/10/14 21:55:35 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.293 2007/11/20 22:32:01 wolf31o2 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
739make_desktop_entry() { 739make_desktop_entry() {
740 [[ -z $1 ]] && eerror "make_desktop_entry: You must specify the executable" && return 1 740 [[ -z $1 ]] && eerror "make_desktop_entry: You must specify the executable" && return 1
741 741
742 local exec=${1} 742 local exec=${1}
743 local name=${2:-${PN}} 743 local name=${2:-${PN}}
744 local icon=${3:-${PN}.png} 744 local icon=${3:-${PN}}
745 local type=${4} 745 local type=${4}
746 local path=${5} 746 local path=${5}
747 747
748 if [[ -z ${type} ]] ; then 748 if [[ -z ${type} ]] ; then
749 local catmaj=${CATEGORY%%-*} 749 local catmaj=${CATEGORY%%-*}
873 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" 873 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
874 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop 874 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
875 875
876 cat <<-EOF > "${desktop}" 876 cat <<-EOF > "${desktop}"
877 [Desktop Entry] 877 [Desktop Entry]
878 Encoding=UTF-8
879 Version=1.0 878 Version=1.0
880 Name=${name} 879 Name=${name}
881 Type=Application 880 Type=Application
882 Comment=${DESCRIPTION} 881 Comment=${DESCRIPTION}
883 Exec=${exec} 882 Exec=${exec}
884 TryExec=${exec%% *} 883 TryExec=${exec%% *}
885 Path=${path}
886 Icon=${icon} 884 Icon=${icon}
887 Categories=${type}; 885 Categories=${type};
888 EOF 886 EOF
887
888 [[ ${path} ]] && echo "Path=${path}" >> "${desktop}"
889 889
890 ( 890 (
891 # wrap the env here so that the 'insinto' call 891 # wrap the env here so that the 'insinto' call
892 # doesn't corrupt the env of the caller 892 # doesn't corrupt the env of the caller
893 insinto /usr/share/applications 893 insinto /usr/share/applications
936 local command=$2 936 local command=$2
937 local desktop=${T}/${wm}.desktop 937 local desktop=${T}/${wm}.desktop
938 938
939 cat <<-EOF > "${desktop}" 939 cat <<-EOF > "${desktop}"
940 [Desktop Entry] 940 [Desktop Entry]
941 Encoding=UTF-8
942 Name=${title} 941 Name=${title}
943 Comment=This session logs you into ${title} 942 Comment=This session logs you into ${title}
944 Exec=${command} 943 Exec=${command}
945 TryExec=${command} 944 TryExec=${command}
946 Type=Application 945 Type=Application

Legend:
Removed from v.1.292  
changed lines
  Added in v.1.293

  ViewVC Help
Powered by ViewVC 1.1.20