[Pkg-php-commits] r876 - php5/branches/rg-extension-manager/debian

Raphael Geissert atomo64-guest at alioth.debian.org
Wed Sep 19 01:31:52 UTC 2007


Author: atomo64-guest
Date: 2007-09-19 01:31:52 +0000 (Wed, 19 Sep 2007)
New Revision: 876

Modified:
   php5/branches/rg-extension-manager/debian/changelog
   php5/branches/rg-extension-manager/debian/php5disext
   php5/branches/rg-extension-manager/debian/php5enext
Log:
Removed apache as known SAPI and improved the extension manager scripts

Modified: php5/branches/rg-extension-manager/debian/changelog
===================================================================
--- php5/branches/rg-extension-manager/debian/changelog	2007-09-17 22:55:13 UTC (rev 875)
+++ php5/branches/rg-extension-manager/debian/changelog	2007-09-19 01:31:52 UTC (rev 876)
@@ -2,8 +2,11 @@
 
   * NOT RELEASED YET
 
- -- sean finney <seanius at debian.org>  Sun, 16 Sep 2007 15:44:40 +0200
+  [ Raphael Geissert ]
+  * Added new extensions manager (see http://wiki.debian.org/PHP)
 
+ -- Raphael Geissert <atomo64 at gmail.com>  Tue, 18 Sep 2007 17:10:26 -0500
+
 php5 (5.2.4-1) unstable; urgency=low
 
   * New upstream release.

Modified: php5/branches/rg-extension-manager/debian/php5disext
===================================================================
--- php5/branches/rg-extension-manager/debian/php5disext	2007-09-17 22:55:13 UTC (rev 875)
+++ php5/branches/rg-extension-manager/debian/php5disext	2007-09-19 01:31:52 UTC (rev 876)
@@ -8,62 +8,73 @@
 QUIET=0
 FATAL=1
 
-if [ -z $1 ] || [ -z $2 ]; then
-	echo "Usage: php5disext SAPIS EXTENSION [quiet] [fatal]"
+if [ -z "$1" ] || [ -z "$2" ]; then
+	echo "Usage: php5disext SAPIS EXTENSION [verbose|quiet] [fatal|nonfatal]"
 	echo -e "\t SAPIS: list of SAPIs or 'all'"
-	echo -e "\t quiet: set any value"
+	echo -e "\t quiet: Don't display any messages (not default)"
 	echo -e "\t fatal: exit with non-zero status if the extension is already disabled (default)"
-	echo "NOTE: The posible values for quiet and fatal are:"
-	echo -e "\tPositive: true|1|quiet|yes|fatal"
-	echo -e "\tNegative: false|0|verbose|shout|no|nonfatal"
-	echo "NOTE: quiet, fatal, verbose and nonfatal do not aplly to both"
 	exit 1
 fi
 
-if [ ! -z $3 ]; then
-	case $3 in
-		true|1|quiet|yes)
+readOption() {
+	
+	case $OPT in
+		quiet)
 			QUIET=1
 		;;
-		false|0|verbose|shout|no)
+		verbose)
 			QUIET=0
 		;;
+                fatal)
+                        FATAL=1
+                ;;
+                nonfatal)
+                        FATAL=0
+                ;;
 	esac
+}
+
+# verbose|quiet and fatal|nonfatal can actually be in any order
+if [ ! -z "$3" ]; then
+        OPT="$3"
+        readOption
 fi
 
-if [ ! -z $4 ]; then
-	case $4 in
-		true|1|fatal|yes)
-			FATAL=1
-		;;
-		false|0|nonfatal|no)
-			FATAL=0
-		;;
-	esac
+if [ ! -z "$4" ]; then
+	OPT="$4"
+	readOption
 fi
 
-EXT="${2}"
-EXT_SO="${2}.so"
-SAPIS="${1}"
+EXT="$2"
+EXT_SO="$EXT.so"
+SAPIS="$1"
 
-if [ $SAPIS = "all" ]; then
-	SAPIS="apache apache2 cli cgi"
+if [ "$SAPIS" = "all" ]; then
+	SAPIS="apache2 cli cgi"
 fi
 
 for SAPI in $SAPIS; do
-	if [ ! -L "${PHPDIR}/${SAPI}/conf.d/${EXT_SO}" ]; then
+	# check for still-not-directory $SAPI/conf.d
+	if [ ! -d "$PHPDIR/$SAPI/conf.d"]; then
 		if [ ! $QUIET -eq 1 ];then
-			echo "The extension ${EXT} is not enabled for ${SAPI}"
+                	echo "$PHPDIR/$SAPI/conf.d is not a directory!" > &2
+                fi
+		exit 3
+	fi
+
+	if [ ! -L "$PHPDIR/$SAPI/conf.d/$EXT_SO" ]; then
+		if [ ! $QUIET -eq 1 ];then
+			echo "The $EXT extension is not enabled on the $SAPI SAPI!"
 		fi
 		
 		if [ $FATAL -eq 1 ]; then
 			exit 2
 		fi
 	else
-		unlink "${PHPDIR}/${SAPI}/conf.d/${EXT_SO}"
+		unlink "$PHPDIR/conf.d/$EXT_SO"
 		if [ ! $QUIET -eq 1 ];then
-			echo "The extension ${EXT} has been disabled for ${SAPI}"
-			echo "In case ${SAPI} is a web server you might need to reload it"
+			echo "The $EXT extension has been disabled on the $SAPI SAPI"
+			echo "In case $SAPI is a web server you might need to restart it"
 		fi
 	fi
 fi

Modified: php5/branches/rg-extension-manager/debian/php5enext
===================================================================
--- php5/branches/rg-extension-manager/debian/php5enext	2007-09-17 22:55:13 UTC (rev 875)
+++ php5/branches/rg-extension-manager/debian/php5enext	2007-09-19 01:31:52 UTC (rev 876)
@@ -8,62 +8,73 @@
 QUIET=0
 FATAL=1
 
-if [ -z $1 ] || [ -z $2 ]; then
-	echo "Usage: php5enext SAPIS EXTENSION [quiet] [fatal]"
+if [ -z "$1" ] || [ -z "$2" ]; then
+	echo "Usage: php5enext SAPIS EXTENSION [verbose|quiet] [fatal|nonfatal]"
 	echo -e "\t SAPIS: list of SAPIs or 'all'"
-	echo -e "\t quiet: set any value"
+	echo -e "\t quiet: Don't display any messages (not default)"
 	echo -e "\t fatal: exit with non-zero status if the extension is already enabled (default)"
-	echo "NOTE: The posible values for quiet and fatal are:"
-	echo -e "\tPositive: true|1|quiet|yes|fatal"
-	echo -e "\tNegative: false|0|verbose|shout|no|nonfatal"
-	echo "NOTE: quiet, fatal, verbose and nonfatal do not aplly to both"
 	exit 1
 fi
 
-if [ ! -z $3 ]; then
-	case $3 in
-		true|1|quiet|yes)
+readOption() {
+	
+	case $OPT in
+		quiet)
 			QUIET=1
 		;;
-		false|0|verbose|shout|no)
+		verbose)
 			QUIET=0
 		;;
+                fatal)
+                        FATAL=1
+                ;;
+                nonfatal)
+                        FATAL=0
+                ;;
 	esac
+}
+
+# verbose|quiet and fatal|nonfatal can actually be in any order
+if [ ! -z "$3" ]; then
+        OPT="$3"
+        readOption
 fi
 
-if [ ! -z $4 ]; then
-	case $4 in
-		true|1|fatal|yes)
-			FATAL=1
-		;;
-		false|0|nonfatal|no)
-			FATAL=0
-		;;
-	esac
+if [ ! -z "$4" ]; then
+	OPT="$4"
+	readOption
 fi
 
-EXT="${2}"
-EXT_SO="${2}.so"
-SAPIS="${1}"
+EXT="$2"
+EXT_SO="$EXT.so"
+SAPIS="$1"
 
-if [ $SAPIS = "all" ]; then
-	SAPIS="apache apache2 cli cgi"
+if [ "$SAPIS" = "all" ]; then
+	SAPIS="apache2 cli cgi"
 fi
 
 for SAPI in $SAPIS; do
-	if [ -L "${PHPDIR}/${SAPI}/conf.d/${EXT_SO}" ]; then
+	# check for still-not-directory $SAPI/conf.d
+	if [ ! -d "$PHPDIR/$SAPI/conf.d"]; then
 		if [ ! $QUIET -eq 1 ];then
-			echo "The extension ${EXT} is already enabled for ${SAPI}"
+                	echo "$PHPDIR/$SAPI/conf.d is not a directory!" > &2
+                fi
+		exit 3
+	fi
+
+	if [ -L "$PHPDIR/$SAPI/conf.d/$EXT_SO" ]; then
+		if [ ! $QUIET -eq 1 ];then
+			echo "The $EXT extension is already enabled on the $SAPI SAPI"
 		fi
 		
 		if [ $FATAL -eq 1 ]; then
 			exit 2
 		fi
 	else
-		ln -s "${PHPDIR}/conf.d/${EXT_SO}" "${PHPDIR}/${SAPI}/conf.d/"
+		ln -s "$PHPDIR/conf.d/$EXT_SO" "$PHPDIR/$SAPI/conf.d/"
 		if [ ! $QUIET -eq 1 ];then
-			echo "The extension ${EXT} has been enabled for ${SAPI}"
-			echo "In case ${SAPI} is a web server you might need to reload it"
+			echo "The $EXT extension has been enabled on the $SAPI SAPI"
+			echo "In case $SAPI is a web server you might need to restart it"
 		fi
 	fi
 fi




More information about the Pkg-php-commits mailing list