/[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.154
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.154 2005/02/23 01:10:58 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.
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.154

  ViewVC Help
Powered by ViewVC 1.1.20