packages: php/dep-tests.sh - get the sort order same way php loads (ini fil...

glen glen at pld-linux.org
Thu Dec 3 07:58:26 CET 2009


Author: glen                         Date: Thu Dec  3 06:58:26 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- get the sort order same way php loads (ini files sorting)

---- Files affected:
packages/php:
   dep-tests.sh (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: packages/php/dep-tests.sh
diff -u packages/php/dep-tests.sh:1.2 packages/php/dep-tests.sh:1.3
--- packages/php/dep-tests.sh:1.2	Thu Dec  3 07:44:53 2009
+++ packages/php/dep-tests.sh	Thu Dec  3 07:58:21 2009
@@ -1,19 +1,18 @@
 #!/bin/sh
 # inter-dependencies checker.
 
-# spl must be loaded before simplexml, therefore spl has itself before its deps
-dep_spl="pcre spl simplexml"
+dep_spl="pcre simplexml"
 dep_filter='pcre'
 dep_eaccelerator='session'
-dep_mysqli="$dep_spl"
-dep_pdo="$dep_spl"
+dep_mysqli="$dep_spl spl"
+dep_pdo="$dep_spl spl"
 dep_pdo_sqlite="$dep_pdo pdo"
 dep_pdo_pgsql="$dep_pdo pdo"
 dep_pdo_odbc="$dep_pdo pdo"
 dep_pdo_firebird="$dep_pdo pdo"
 dep_pdo_dblib="$dep_pdo pdo"
 dep_pdo_mysql="$dep_pdo pdo"
-dep_simplexml="$dep_spl"
+dep_simplexml="$dep_spl spl"
 dep_sqlite="$dep_pdo pdo"
 dep_wddx='xml'
 dep_xmlreader='dom'
@@ -22,17 +21,29 @@
 
 php=${PHP:-$(php-config --php-binary)}
 ext_dir=${EXTENSION_DIR:-$(php-config --extension-dir)}
-conf_dir=${CONFIG_DIR:-$(php-config --sysconfdir)/conf.d}
+conf_dir=${CONFIG_DIR:-$(php-config --sysconfdir)/conf.d $(php-config --sysconfdir)/cli.d}
+tmpini=$(mktemp)
 
 # poldek --sn ac-ready -u php-*
 for ext in $ext_dir/*.so; do
 	[ -f $ext ] || continue
 	ext=${ext##*/}; ext=${ext%.so}
+
 	deps=$(eval echo \$dep_$ext)
 	# add ext itself, if already not in list (spl case)
 	[[ $deps = *$ext* ]] || deps="$deps $ext"
 
-	args=$(for e in $deps; do echo -d extension=$e.so; done)
 	echo -n "$ext (deps: ${deps# })..."
-	$php -n -d extension_dir=$ext_dir $args -r "exit(extension_loaded('${ext}') ? 0 : 1);" && echo OK || echo FAIL
+
+	grep -rlE '^extension=('$(echo "${deps# }" | tr ' ' '|')').so$' $conf_dir | LC_CTYPE=C LC_ALL= sort | xargs cat > $tmpini
+	$php -n -d extension_dir=$ext_dir -c $tmpini -r "exit(extension_loaded('${ext}') ? 0 : 1);"
+	rc=$?
+	if [ $rc = 0 ]; then
+		echo OK
+	else
+		echo FAIL
+		echo "Failed config was:"
+		cat $tmpini
+	fi
 done
+rm -f $t
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php/dep-tests.sh?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list