| 1 | # Copyright 1999-2007 Gentoo Foundation |
1 | # Copyright 1999-2007 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.314 2009/02/21 07:35:14 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.315 2009/02/21 23:28:21 vapier Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: eutils.eclass |
5 | # @ECLASS: eutils.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # base-system@gentoo.org |
7 | # base-system@gentoo.org |
| 8 | # @BLURB: many extra (but common) functions that are used in ebuilds |
8 | # @BLURB: many extra (but common) functions that are used in ebuilds |
| … | |
… | |
| 1583 | # of the lists. |
1583 | # of the lists. |
| 1584 | strip-linguas() { |
1584 | strip-linguas() { |
| 1585 | local ls newls nols |
1585 | local ls newls nols |
| 1586 | if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then |
1586 | if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then |
| 1587 | local op=$1; shift |
1587 | local op=$1; shift |
| 1588 | ls=$(find "$1" -name '*.po' -exec basename {} .po \;); shift |
1588 | ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift |
| 1589 | local d f |
1589 | local d f |
| 1590 | for d in "$@" ; do |
1590 | for d in "$@" ; do |
| 1591 | if [[ ${op} == "-u" ]] ; then |
1591 | if [[ ${op} == "-u" ]] ; then |
| 1592 | newls=${ls} |
1592 | newls=${ls} |
| 1593 | else |
1593 | else |
| 1594 | newls="" |
1594 | newls="" |
| 1595 | fi |
1595 | fi |
| 1596 | for f in $(find "$d" -name '*.po' -exec basename {} .po \;) ; do |
1596 | for f in $(find "$d" -name '*.po' -exec basename {} .po ';') ; do |
| 1597 | if [[ ${op} == "-i" ]] ; then |
1597 | if [[ ${op} == "-i" ]] ; then |
| 1598 | hasq ${f} ${ls} && newls="${newls} ${f}" |
1598 | hasq ${f} ${ls} && newls="${newls} ${f}" |
| 1599 | else |
1599 | else |
| 1600 | hasq ${f} ${ls} || newls="${newls} ${f}" |
1600 | hasq ${f} ${ls} || newls="${newls} ${f}" |
| 1601 | fi |
1601 | fi |