From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from <gentoo-commits+bounces-361846-garchives=archives.gentoo.org@lists.gentoo.org>) id 1QgHSJ-0001O9-Gx for garchives@archives.gentoo.org; Mon, 11 Jul 2011 14:27:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4841321C053; Mon, 11 Jul 2011 14:27:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 18DA321C053 for <gentoo-commits@lists.gentoo.org>; Mon, 11 Jul 2011 14:27:19 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 657E82AC198 for <gentoo-commits@lists.gentoo.org>; Mon, 11 Jul 2011 14:27:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 737088003D for <gentoo-commits@lists.gentoo.org>; Mon, 11 Jul 2011 14:27:17 +0000 (UTC) From: "Zac Medico" <zmedico@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org> Message-ID: <f8504d36c50bef4c1a982a4b9262d3e8e15f438b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/isolated-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: f8504d36c50bef4c1a982a4b9262d3e8e15f438b Date: Mon, 11 Jul 2011 14:27:17 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 21acca39283d8278f9e2cac59faa9e35 commit: f8504d36c50bef4c1a982a4b9262d3e8e15f438b Author: Brian Harring <ferringb <AT> gmail <DOT> com> AuthorDate: Mon Jul 11 08:33:21 2011 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Mon Jul 11 14:26:28 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Df8504d36 ebuild.sh: restore old has() implementation The needle/haystack implementation handles whitespace as originally intended (prior to commit 659eafddd5964820ce8bdc0d90f5fcf7df04b5b7), as discussed in bug #374791. Signed-off-by: Brian Harring <ferringb <AT> gmail.com> --- bin/isolated-functions.sh | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 9d63397..574f949 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -525,7 +525,14 @@ hasv() { } =20 has() { - [[ " ${*:2} " =3D=3D *" $1 "* ]] + local needle=3D$1 + shift + + local x + for x in "$@"; do + [ "${x}" =3D "${needle}" ] && return 0 + done + return 1 } =20 # @FUNCTION: save_ebuild_env