[Webapps-common-discuss] webapps-common/internal common, 1.3, 1.4 httpd, 1.2, 1.3

seanius at haydn.debian.org seanius at haydn.debian.org
Wed Aug 17 16:40:45 UTC 2005


Update of /cvsroot/webapps-common/webapps-common/internal
In directory haydn:/org/alioth.debian.org/chroot/home/users/seanius/tmp/cvs-serv7055/internal

Modified Files:
	common httpd 
Log Message:
this is a huge chunk of work i did in the past week's offline travelling.
the UI/debconf stuff is mostly sorted out at this point, and now we need
to work out the 'do stuff' side of things, which should be fairly easy since
most of the code is still there.



Index: common
===================================================================
RCS file: /cvsroot/webapps-common/webapps-common/internal/common,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- common	3 Aug 2005 04:48:40 -0000	1.3
+++ common	17 Aug 2005 16:40:41 -0000	1.4
@@ -25,3 +25,64 @@
 		shift
 	done
 }
+
+_wc_list_add(){
+	local list member
+	list=$1
+	member=$2
+
+	if ! _wc_list_is_member "$list" "$member"; then
+		if [ "$list" ]; then
+			list="$list, $member"
+		else
+			list="$member"
+		fi
+	fi
+	echo $list
+}
+
+_wc_list_join(){
+	local biglist list1 list2 member
+	list1=$1
+	list2=$2
+	if [ "$list1" ]; then biglist="$list1, "; fi
+	if [ "$list2" ]; then biglist="${biglist}$list2"; fi
+
+	echo $biglist | sed -e 's/, /\n/g' | sort | uniq | paste -s |\
+		sed -e 's/\t/, /g'
+}
+
+_wc_list_is_member(){
+	local list query
+	list="$1"
+	query="$2"
+
+	echo "$list" | grep -qw "$query"
+}
+
+_wc_list_remove(){
+	local list query
+	list="$1"
+	query="$2"
+
+	echo $list | sed -e "s/^$query, //" -e "s/, $query\([,\$]\)\?/\1/" 
+}
+
+_wc_list_explode(){
+	local list
+	list="$1"
+	echo $list | sed -e 's/, \?/	/g'
+}
+
+_wc_list_create(){
+	local list members m
+	members=$*
+	for m in `echo $members | sort`; do
+		if [ ! "$list" ]; then
+			list="$m"
+		else
+			list="$list, $m"
+		fi
+	done
+	echo $list
+}

Index: httpd
===================================================================
RCS file: /cvsroot/webapps-common/webapps-common/internal/httpd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- httpd	2 Aug 2005 23:57:47 -0000	1.2
+++ httpd	17 Aug 2005 16:40:41 -0000	1.3
@@ -53,7 +53,7 @@
 #
 # no servers implies to invoke all running servers
 wc_httpd_invoke(){
-	local httpds cmd
+	local httpds cmd err
 	if [ ! "$1" ]; then
 		echo "i need at least a command!" 2>&1
 		return 1
@@ -67,7 +67,7 @@
 	fi
 	for f in $httpds; do
 		if [ -x /etc/init.d/$f ]; then
-			invoke-rc.d $f $cmd
+			invoke-rc.d $f $cmd || return $?
 		fi
 	done
 }




More information about the Webapps-common-discuss mailing list