[Webapps-common-discuss] webapps-common/dpkg common,1.8,1.9

seanius at haydn.debian.org seanius at haydn.debian.org
Sat Apr 1 17:53:44 UTC 2006


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

Modified Files:
	common 
Log Message:
another couple misc fixes


Index: common
===================================================================
RCS file: /cvsroot/webapps-common/webapps-common/dpkg/common,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- common	1 Apr 2006 16:32:21 -0000	1.8
+++ common	1 Apr 2006 17:53:40 -0000	1.9
@@ -64,6 +64,7 @@
 	# get the previously available list of vhosts, if they exist
 	if [ -f "$wc_vhostconfig" ]; then
 		old_vhost_list=`grep -vE '^[[:space:]]*#' "$wc_vhostconfig"` || true
+		old_vhost_list=`_wc_list_create $old_vhost_list`
 		cp "$wc_vhostconfig" "$tfile"
 	fi
 	db_metaget $wc_package/httpd/virtualhost choices && vhost_list="$RET"
@@ -394,7 +395,7 @@
 ###	this should only be called in the config script, i guess
 ###
 wc_preseed_debconf(){
-	local v vhosts
+	local v old_vhosts vhosts
 	_wc_debug "wc_preseed_debconf() $@"
 
 	# set the master control flag
@@ -405,13 +406,22 @@
 	# get the list of virtualhosts for which this app is configured
 	if [ -f "$wc_siteconf" ]; then
 		vhosts=`grep -vE '^[[:space:]]*#' "$wc_siteconf" | cut -f1`
-		# preseed each vhost debconf structure for this package.
-		for v in $vhosts; do
-			wc_register_debconf "$v"
-			wc_preseed_debconf_vhost "$v"
-		done
 		vhosts=`_wc_list_create $vhosts`
 	fi
+
+	# get any pre-existing vhosts from global configuration
+	if [ -f "$wc_vhostconfig" ]; then
+		old_vhosts=`grep -vE '^[[:space:]]*#' "$wc_vhostconfig"` || true
+		old_vhosts=`_wc_list_create $old_vhosts`
+	fi
+	vhosts=`_wc_list_join "$old_vhosts" "$vhosts"`
+
+	# preseed each vhost debconf structure for this package.
+	for v in `_wc_list_explode "$vhosts"`; do
+		wc_register_debconf "$v"
+		wc_preseed_debconf_vhost "$v"
+	done
+
 	# and of course add the new vhost option
 	vhosts=`_wc_list_add "[new vhost]" "$vhosts"`
 	db_subst $wc_package/httpd/virtualhost vhosts "$vhosts"
@@ -426,6 +436,8 @@
 	local vhost vhost_grep vdir httpds debconf_dest
 	_wc_debug "wc_preseed_debconf_vhost() $@"
 
+	if [ ! -f "$wc_siteconf" ]; then return 0; fi
+
 	vhost="$1"
 
 	vhost_grep="grep -E ^$vhost[[:space:]] $wc_siteconf"




More information about the Webapps-common-discuss mailing list