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

Diff of /eclass/eutils.eclass

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

Revision 1.153 Revision 1.157
1# Copyright 1999-2004 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.153 2005/02/18 21:55:35 azarah Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.157 2005/03/07 17:45:07 carlo 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.
909# name: the name that will show up in the menu 909# name: the name that will show up in the menu
910# icon: give your little like a pretty little icon ... 910# icon: give your little like a pretty little icon ...
911# this can be relative (to /usr/share/pixmaps) or 911# this can be relative (to /usr/share/pixmaps) or
912# a full path to an icon 912# a full path to an icon
913# type: what kind of application is this ? for categories: 913# type: what kind of application is this ? for categories:
914# http://www.freedesktop.org/standards/menu-spec/ 914# http://www.freedesktop.org/wiki/Standards_2fmenu_2dspec
915# path: if your app needs to startup in a specific dir 915# path: if your app needs to startup in a specific dir
916make_desktop_entry() { 916make_desktop_entry() {
917 [ -z "$1" ] && eerror "make_desktop_entry: You must specify the executable" && return 1 917 [ -z "$1" ] && eerror "make_desktop_entry: You must specify the executable" && return 1
918 918
919 local exec="${1}" 919 local exec="${1}"
941 type= 941 type=
942 subdir= 942 subdir=
943 ;; 943 ;;
944 esac 944 esac
945 fi 945 fi
946 local desktop="${T}/${exec}.desktop" 946 local desktop="${T}/${exec%% *}-${P}.desktop"
947 947
948echo "[Desktop Entry] 948echo "[Desktop Entry]
949Encoding=UTF-8 949Encoding=UTF-8
950Version=0.9.2 950Version=0.9.2
951Name=${name} 951Name=${name}
1479# directories and uses the intersection of the lists. 1479# directories and uses the intersection of the lists.
1480# The -u builds a list of po files found in all the 1480# The -u builds a list of po files found in all the
1481# directories and uses the union of the lists. 1481# directories and uses the union of the lists.
1482strip-linguas() { 1482strip-linguas() {
1483 local ls newls 1483 local ls newls
1484 if [ "$1" == "-i" ] || [ "$1" == "-u" ] ; then 1484 if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then
1485 local op="$1"; shift 1485 local op=$1; shift
1486 ls=" $(find "$1" -name '*.po' -printf '%f ') "; shift 1486 ls=" $(find "$1" -name '*.po' -printf '%f ') "; shift
1487 local d f 1487 local d f
1488 for d in "$@" ; do 1488 for d in "$@" ; do
1489 if [ "${op}" == "-u" ] ; then 1489 if [[ ${op} == "-u" ]] ; then
1490 newls="${ls}" 1490 newls=${ls}
1491 else 1491 else
1492 newls="" 1492 newls=""
1493 fi 1493 fi
1494 for f in $(find "$d" -name '*.po' -printf '%f ') ; do 1494 for f in $(find "$d" -name '*.po' -printf '%f ') ; do
1495 if [ "${op}" == "-i" ] ; then 1495 if [[ ${op} == "-i" ]] ; then
1496 [ "${ls/ ${f} /}" != "${ls}" ] && newls="${newls} ${f}" 1496 [[ ${ls/ ${f} /} != ${ls} ]] && newls="${newls} ${f}"
1497 else 1497 else
1498 [ "${ls/ ${f} /}" == "${ls}" ] && newls="${newls} ${f}" 1498 [[ ${ls/ ${f} /} == ${ls} ]] && newls="${newls} ${f}"
1499 fi 1499 fi
1500 done 1500 done
1501 ls="${newls}" 1501 ls=${newls}
1502 done 1502 done
1503 ls="${ls//.po}" 1503 ls=${ls//.po}
1504 else 1504 else
1505 ls="$@" 1505 ls=$@
1506 fi 1506 fi
1507 1507
1508 ls=" ${ls} " 1508 ls=" ${ls} "
1509 newls="" 1509 newls=""
1510 for f in ${LINGUAS} ; do 1510 for f in ${LINGUAS} ; do
1511 if [ "${ls/ ${f} /}" != "${ls}" ] ; then 1511 if [[ ${ls/ ${f} /} != ${ls} ]] ; then
1512 newls="${newls} ${f}" 1512 newls="${newls} ${f}"
1513 else 1513 else
1514 ewarn "Sorry, but ${PN} does not support the ${f} LINGUA" 1514 ewarn "Sorry, but ${PN} does not support the ${f} LINGUA"
1515 fi 1515 fi
1516 done 1516 done
1517 if [ -z "${newls}" ] ; then 1517 if [[ -z ${newls} ]] ; then
1518 unset LINGUAS 1518 unset LINGUAS
1519 else 1519 else
1520 export LINGUAS="${newls}" 1520 export LINGUAS=${newls:1}
1521 fi 1521 fi
1522} 1522}
1523 1523
1524# moved from kernel.eclass since they are generally useful outside of 1524# moved from kernel.eclass since they are generally useful outside of
1525# kernel.eclass -iggy (20041002) 1525# kernel.eclass -iggy (20041002)

Legend:
Removed from v.1.153  
changed lines
  Added in v.1.157

  ViewVC Help
Powered by ViewVC 1.1.20