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 ) id 1Sjvd6-00079M-BA for garchives@archives.gentoo.org; Wed, 27 Jun 2012 17:02:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 62BC6E0859; Wed, 27 Jun 2012 17:02:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 33F69E0859 for ; Wed, 27 Jun 2012 17:02:05 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9B6751B46E2 for ; Wed, 27 Jun 2012 17:02:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 5E07AE5432 for ; Wed, 27 Jun 2012 17:02:03 +0000 (UTC) From: "Ulrich Mueller" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Mueller" Message-ID: <1340816767.d1b1a4320db209587216626fa744e6e5fcd0e43d.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: /, modules/ X-VCS-Repository: proj/eselect X-VCS-Files: ChangeLog modules/binutils.eselect X-VCS-Directories: / modules/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Mueller X-VCS-Revision: d1b1a4320db209587216626fa744e6e5fcd0e43d X-VCS-Branch: master Date: Wed, 27 Jun 2012 17:02:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 807930cc-5069-4bd4-a82f-afc79553c345 X-Archives-Hash: c40e7b8d8f71b77b0b8f441c5bb28201 commit: d1b1a4320db209587216626fa744e6e5fcd0e43d Author: Ulrich M=C3=BCller gentoo org> AuthorDate: Wed Jun 27 17:06:07 2012 +0000 Commit: Ulrich Mueller gentoo org> CommitDate: Wed Jun 27 17:06:07 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/eselect.git;a= =3Dcommit;h=3Dd1b1a432 Properly quote variables to prevent false globbing, bug 423525. * modules/binutils.eselect (find_targets): Properly quote variables to prevent false globbing, bug 423525. --- ChangeLog | 5 +++++ modules/binutils.eselect | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index da8bb61..968dfa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-06-27 Ulrich M=C3=BCller + + * modules/binutils.eselect (find_targets): Properly quote + variables to prevent false globbing, bug 423525. + 2012-03-07 Ulrich M=C3=BCller =20 * doc/release-guide.txt: Update to reflect the transition from diff --git a/modules/binutils.eselect b/modules/binutils.eselect index 6bf0657..8694bd5 100644 --- a/modules/binutils.eselect +++ b/modules/binutils.eselect @@ -12,17 +12,17 @@ BINUTILS_ENVFILE=3D${EROOT}/etc/env.d/05binutils # find_targets [patterns] # find all possible targets [that match one of ${@}] find_targets() { - local args=3D${@} targets - [[ -z ${args[@]} ]] && args=3D'-*' - for item in ${args} ; do + local item targets + [[ $# -eq 0 ]] && set -- "-*" + for item; do item=3D${item%%-[1-9]*} - [[ ${item:0:1} =3D=3D '-' ]] || item=3D-${item} - for file in "${EROOT}"/etc/env.d/binutils/config${item} ; do + [[ ${item:0:1} =3D=3D "-" ]] || item=3D-${item} + for file in "${EROOT}"/etc/env.d/binutils/config${item}; do [[ -f ${file} ]] || continue - targets=3D(${targets[@]} "${file##*/config-}") + targets=3D("${targets[@]}" "${file##*/config-}") done done - echo ${targets[@]} + echo "${targets[@]}" } =20 # find_versions