From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1E30C58973 for ; Fri, 22 Jan 2016 03:15:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E184021C029; Fri, 22 Jan 2016 03:15:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CD8F621C027 for ; Fri, 22 Jan 2016 03:15:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B5C0F340766 for ; Fri, 22 Jan 2016 03:15:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AB0351074 for ; Fri, 22 Jan 2016 03:15:43 +0000 (UTC) From: "Michael Orlitzky" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" Message-ID: <1453428714.32f6c1c424df3e8f7ed9705323e2911ee43b7696.mjo@gentoo> Subject: [gentoo-commits] proj/eselect-php:master commit in: src/ X-VCS-Repository: proj/eselect-php X-VCS-Files: src/php.eselect.in.in X-VCS-Directories: src/ X-VCS-Committer: mjo X-VCS-Committer-Name: Michael Orlitzky X-VCS-Revision: 32f6c1c424df3e8f7ed9705323e2911ee43b7696 X-VCS-Branch: master Date: Fri, 22 Jan 2016 03:15:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 5099f621-0bfd-4796-a24a-6e81340b9821 X-Archives-Hash: 82178155d5d0bc091d5dee92290a07b0 commit: 32f6c1c424df3e8f7ed9705323e2911ee43b7696 Author: Michael Orlitzky gentoo org> AuthorDate: Fri Jan 22 02:11:54 2016 +0000 Commit: Michael Orlitzky gentoo org> CommitDate: Fri Jan 22 02:11:54 2016 +0000 URL: https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=32f6c1c4 Clean up and document find_targets(). src/php.eselect.in.in | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/php.eselect.in.in b/src/php.eselect.in.in index 0c83de7..e1edb42 100644 --- a/src/php.eselect.in.in +++ b/src/php.eselect.in.in @@ -214,15 +214,17 @@ update_sapi() { set_$sapi $target } -find_targets() { - local dirs - - for dir in "@libdir@"/php*.*; do - t=$(basename $dir) - has $t $dirs || dirs="${dirs} $t" - done - echo $dirs +# +# Find all valid target names by searching libdir for directories like +# php5.6, php7.0, etc. +# +# OUTPUT: +# +# A space-separated list of target names, for example, "php5.6 php7.0". +# +find_targets() { + cd "@LIBDIR@" && echo php*.* } # List all valid targets for the given SAPI. The list is obtained by