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

Diff of /eclass/eutils.eclass

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

Revision 1.166 Revision 1.167
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 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.166 2005/04/15 22:01:42 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.167 2005/04/16 07:05:45 vapier Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
1009# make_desktop_entry(<title>, <command>) 1009# make_desktop_entry(<title>, <command>)
1010# title: File to execute to start the Window Manager 1010# title: File to execute to start the Window Manager
1011# command: Name of the Window Manager 1011# command: Name of the Window Manager
1012 1012
1013make_session_desktop() { 1013make_session_desktop() {
1014
1015 [ -z "$1" ] && eerror "make_session_desktop: You must specify the title" && return 1 1014 [[ -z $1 ]] && eerror "make_session_desktop: You must specify the title" && return 1
1016 [ -z "$2" ] && eerror "make_session_desktop: You must specify the command" && return 1 1015 [[ -z $2 ]] && eerror "make_session_desktop: You must specify the command" && return 1
1017 1016
1018 local title="${1}" 1017 local title=$1
1019 local command="${2}" 1018 local command=$2
1020 local desktop="${T}/${wm}.desktop" 1019 local desktop=${T}/${wm}.desktop
1021 1020
1022echo "[Desktop Entry] 1021echo "[Desktop Entry]
1023Encoding=UTF-8 1022Encoding=UTF-8
1024Name=${title} 1023Name=${title}
1025Comment=This session logs you into ${title} 1024Comment=This session logs you into ${title}
1027TryExec=${command} 1026TryExec=${command}
1028Type=Application" > "${desktop}" 1027Type=Application" > "${desktop}"
1029 1028
1030 insinto /usr/share/xsessions 1029 insinto /usr/share/xsessions
1031 doins "${desktop}" 1030 doins "${desktop}"
1032
1033 return 0
1034} 1031}
1035 1032
1036domenu() { 1033domenu() {
1037 local i 1034 local i j
1038 local j
1039 insinto /usr/share/applications 1035 insinto /usr/share/applications
1040 for i in ${@} 1036 for i in "$@" ; do
1041 do
1042 if [ -f "${i}" ]; 1037 if [[ -f ${i} ]] ; then
1043 then
1044 doins ${i} 1038 doins "${i}"
1045 elif [ -d "${i}" ]; 1039 elif [[ -d ${i} ]] ; then
1046 then
1047 for j in ${i}/*.desktop 1040 for j in "${i}"/*.desktop ; do
1048 do
1049 doins ${j} 1041 doins "${j}"
1050 done 1042 done
1051 fi 1043 fi
1052 done 1044 done
1053} 1045}
1046newmenu() {
1047 insinto /usr/share/applications
1048 newins "$1" "$2"
1049}
1054 1050
1055doicon() { 1051doicon() {
1056 local i 1052 local i j
1057 local j
1058 insinto /usr/share/pixmaps 1053 insinto /usr/share/pixmaps
1059 for i in ${@} 1054 for i in "$@" ; do
1060 do
1061 if [ -f "${i}" ]; 1055 if [[ -f ${i} ]] ; then
1062 then
1063 doins ${i} 1056 doins "${i}"
1064 elif [ -d "${i}" ]; 1057 elif [[ -d ${i} ]] ; then
1065 then
1066 for j in ${i}/*.png 1058 for j in "${i}"/*.png ; do
1067 do
1068 doins ${j} 1059 doins "${j}"
1069 done 1060 done
1070 fi 1061 fi
1071 done 1062 done
1063}
1064newicon() {
1065 insinto /usr/share/pixmaps
1066 newins "$1" "$2"
1072} 1067}
1073 1068
1074############################################################## 1069##############################################################
1075# END: Handle .desktop files and menu entries # 1070# END: Handle .desktop files and menu entries #
1076############################################################## 1071##############################################################

Legend:
Removed from v.1.166  
changed lines
  Added in v.1.167

  ViewVC Help
Powered by ViewVC 1.1.20