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

Diff of /eclass/eutils.eclass

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

Revision 1.233 Revision 1.237
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2006 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.233 2006/04/19 03:53:19 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.237 2006/06/04 15:18:12 vapier Exp $
4#
5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 4#
7# This eclass is for general purpose functions that most ebuilds 5# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 6# have to implement themselves.
9# 7#
10# NB: If you add anything, please comment it! 8# NB: If you add anything, please comment it!
891 local desktop_name="${PN}" 889 local desktop_name="${PN}"
892 else 890 else
893 local desktop_name="${PN}-${SLOT}" 891 local desktop_name="${PN}-${SLOT}"
894 fi 892 fi
895 local desktop=${T}/${exec%% *}-${desktop_name}.desktop 893 local desktop=${T}/${exec%% *}-${desktop_name}.desktop
894# local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
896 895
897echo "[Desktop Entry] 896echo "[Desktop Entry]
898Encoding=UTF-8 897Encoding=UTF-8
899Version=0.9.2 898Version=0.9.2
900Name=${name} 899Name=${name}
901Type=Application 900Type=Application
902Comment=${DESCRIPTION} 901Comment=${DESCRIPTION}
903Exec=${exec} 902Exec=${exec}
903TryExec=${exec}
904Path=${path} 904Path=${path}
905Icon=${icon} 905Icon=${icon}
906Categories=Application;${type};" > "${desktop}" 906Categories=Application;${type};" > "${desktop}"
907 907
908 ( 908 (
1439# directories and uses the union of the lists. 1439# directories and uses the union of the lists.
1440strip-linguas() { 1440strip-linguas() {
1441 local ls newls 1441 local ls newls
1442 if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then 1442 if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then
1443 local op=$1; shift 1443 local op=$1; shift
1444 ls=" $(find "$1" -name '*.po' -exec basename {} \;) "; shift 1444 ls=$(find "$1" -name '*.po' -exec basename {} .po \;); shift
1445 local d f 1445 local d f
1446 for d in "$@" ; do 1446 for d in "$@" ; do
1447 if [[ ${op} == "-u" ]] ; then 1447 if [[ ${op} == "-u" ]] ; then
1448 newls=${ls} 1448 newls=${ls}
1449 else 1449 else
1450 newls="" 1450 newls=""
1451 fi 1451 fi
1452 for f in $(find "$d" -name '*.po' -exec basename {} \;) ; do 1452 for f in $(find "$d" -name '*.po' -exec basename {} .po \;) ; do
1453 if [[ ${op} == "-i" ]] ; then 1453 if [[ ${op} == "-i" ]] ; then
1454 [[ ${ls/ ${f} /} != ${ls} ]] && newls="${newls} ${f}" 1454 hasq ${f} ${ls} && newls="${newls} ${f}"
1455 else 1455 else
1456 [[ ${ls/ ${f} /} == ${ls} ]] && newls="${newls} ${f}" 1456 hasq ${f} ${ls} || newls="${newls} ${f}"
1457 fi 1457 fi
1458 done 1458 done
1459 ls=${newls} 1459 ls=${newls}
1460 done 1460 done
1461 ls=${ls//.po}
1462 else 1461 else
1463 ls=$@ 1462 ls="$@"
1464 fi 1463 fi
1465 1464
1466 ls=" ${ls} "
1467 newls="" 1465 newls=""
1468 for f in ${LINGUAS} ; do 1466 for f in ${LINGUAS} ; do
1469 if [[ ${ls/ ${f} /} != ${ls} ]] ; then 1467 if hasq ${f} ${ls} ; then
1470 newls="${newls} ${f}" 1468 newls="${newls} ${f}"
1471 else 1469 else
1472 ewarn "Sorry, but ${PN} does not support the ${f} LINGUA" 1470 ewarn "Sorry, but ${PN} does not support the ${f} LINGUA"
1473 fi 1471 fi
1474 done 1472 done
1475 if [[ -z ${newls} ]] ; then
1476 export LINGUAS=""
1477 else
1478 export LINGUAS=${newls:1} 1473 export LINGUAS=${newls:1}
1479 fi
1480} 1474}
1481 1475
1482# moved from kernel.eclass since they are generally useful outside of 1476# moved from kernel.eclass since they are generally useful outside of
1483# kernel.eclass -iggy (20041002) 1477# kernel.eclass -iggy (20041002)
1484 1478

Legend:
Removed from v.1.233  
changed lines
  Added in v.1.237

  ViewVC Help
Powered by ViewVC 1.1.20