[packages/phpenv] phpenv-system-php: more reliable detect (use package name as input)

glen glen at pld-linux.org
Sun Nov 30 21:52:21 CET 2014


commit a3818057bef81b718d288ed5d391ba8b3dd354f1
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Nov 30 22:52:07 2014 +0200

    phpenv-system-php: more reliable detect (use package name as input)

 phpenv-system-php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/phpenv-system-php b/phpenv-system-php
index fdb74a4..5462876 100755
--- a/phpenv-system-php
+++ b/phpenv-system-php
@@ -19,11 +19,11 @@ if ! which rpm >/dev/null; then
 	exit 1
 fi
 
-for php in /usr/bin/php??; do
-	pkg=$(rpm -qf $php) || continue
+for pkg in $(rpm -qa 'php*-cli'); do
 	version=$(rpm -q --qf '%{VERSION}' $pkg)
 	# use php-X.Y only for version selection
 	version=${version%.${version#*.*.}}-pld
+	php=$(rpm -ql $pkg | grep /usr/bin)
 	echo "* Found $php (via $pkg) using $version as version"
 
 	if [ -d "${PHPENV_ROOT}/versions/$version" ]; then
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/phpenv.git/commitdiff/a3818057bef81b718d288ed5d391ba8b3dd354f1



More information about the pld-cvs-commit mailing list