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

Diff of /eclass/eutils.eclass

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

Revision 1.234 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.234 2006/04/25 15:47:30 wolf31o2 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}
1440# directories and uses the union of the lists. 1439# directories and uses the union of the lists.
1441strip-linguas() { 1440strip-linguas() {
1442 local ls newls 1441 local ls newls
1443 if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then 1442 if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then
1444 local op=$1; shift 1443 local op=$1; shift
1445 ls=" $(find "$1" -name '*.po' -exec basename {} \;) "; shift 1444 ls=$(find "$1" -name '*.po' -exec basename {} .po \;); shift
1446 local d f 1445 local d f
1447 for d in "$@" ; do 1446 for d in "$@" ; do
1448 if [[ ${op} == "-u" ]] ; then 1447 if [[ ${op} == "-u" ]] ; then
1449 newls=${ls} 1448 newls=${ls}
1450 else 1449 else
1451 newls="" 1450 newls=""
1452 fi 1451 fi
1453 for f in $(find "$d" -name '*.po' -exec basename {} \;) ; do 1452 for f in $(find "$d" -name '*.po' -exec basename {} .po \;) ; do
1454 if [[ ${op} == "-i" ]] ; then 1453 if [[ ${op} == "-i" ]] ; then
1455 [[ ${ls/ ${f} /} != ${ls} ]] && newls="${newls} ${f}" 1454 hasq ${f} ${ls} && newls="${newls} ${f}"
1456 else 1455 else
1457 [[ ${ls/ ${f} /} == ${ls} ]] && newls="${newls} ${f}" 1456 hasq ${f} ${ls} || newls="${newls} ${f}"
1458 fi 1457 fi
1459 done 1458 done
1460 ls=${newls} 1459 ls=${newls}
1461 done 1460 done
1462 ls=${ls//.po}
1463 else 1461 else
1464 ls=$@ 1462 ls="$@"
1465 fi 1463 fi
1466 1464
1467 ls=" ${ls} "
1468 newls="" 1465 newls=""
1469 for f in ${LINGUAS} ; do 1466 for f in ${LINGUAS} ; do
1470 if [[ ${ls/ ${f} /} != ${ls} ]] ; then 1467 if hasq ${f} ${ls} ; then
1471 newls="${newls} ${f}" 1468 newls="${newls} ${f}"
1472 else 1469 else
1473 ewarn "Sorry, but ${PN} does not support the ${f} LINGUA" 1470 ewarn "Sorry, but ${PN} does not support the ${f} LINGUA"
1474 fi 1471 fi
1475 done 1472 done
1476 if [[ -z ${newls} ]] ; then
1477 export LINGUAS=""
1478 else
1479 export LINGUAS=${newls:1} 1473 export LINGUAS=${newls:1}
1480 fi
1481} 1474}
1482 1475
1483# moved from kernel.eclass since they are generally useful outside of 1476# moved from kernel.eclass since they are generally useful outside of
1484# kernel.eclass -iggy (20041002) 1477# kernel.eclass -iggy (20041002)
1485 1478

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

  ViewVC Help
Powered by ViewVC 1.1.20