tags 417053 + patch
thanks

Hi,

Attached is the diff for my sympa 5.2.4-1.1 NMU during the current BSP
which I'll upload to delayed-0.

-- 
Luk Claes - http://people.debian.org/~luk - GPG key 1024D/9B7C328D
Fingerprint:   D5AF 25FB 316B 53BB 08E7   F999 E544 DE07 9B7C 328D
diff -u sympa-5.2.4/debian/changelog sympa-5.2.4/debian/changelog
--- sympa-5.2.4/debian/changelog
+++ sympa-5.2.4/debian/changelog
@@ -1,3 +1,10 @@
+sympa (5.2.4-1.1) unstable; urgency=high
+
+  * Non-maintainer upload during BSP.
+  * Fix unconditional use of debconf in postrm (Closes: #417053).
+
+ -- Luk Claes <[EMAIL PROTECTED]>  Sun, 20 May 2007 16:45:30 +0200
+
 sympa (5.2.4-1) unstable; urgency=low
 
   * new upstream release
diff -u sympa-5.2.4/debian/postrm sympa-5.2.4/debian/postrm
--- sympa-5.2.4/debian/postrm
+++ sympa-5.2.4/debian/postrm
@@ -2,16 +2,8 @@
 
 set -e
 
-. /usr/share/debconf/confmodule
-
 case "$1" in
     "remove")
-	# Don't fail here, the package might not be configured yet
-	db_get sympa/use_wwsympa || true
-	use_wwsympa="$RET"
-	db_get sympa/use_soap || true
-	use_soap="$RET"
-
     # Check whether the syslog configuration file is present
     # in case another system log daemon is used instead of syslog
 	if [ -x /usr/sbin/syslog-facility ]; then
@@ -27,69 +19,62 @@
 	    fi
 	fi
 
-	if [ "$use_wwsympa" = "true" -o "$use_soap" = "true" ]; then
-	    ## Remove Web server configuration
-	    db_get wwsympa/webserver_type
-	    webserver="$RET"
-	    
-	    case $webserver in
-			"Apache")
-		    webserver="apache"
-		    ;;
-			"Apache-SSL")
-		    webserver="apache-ssl"
-		    ;;
-			"Apache 2")
-			webserver="apache2"
-			;;
-			*)
-		    webserver="none"
-		    ;;
-	    esac
-
-		if [ "$use_soap" = "true" ]; then
-			# Remove symbolic link to webserver configuration snippet
-			link=`readlink /etc/$webserver/conf.d/sympa-soap || true`
-			if [ "$link" = "/etc/sympa/apache-soap" ]; then
-				rm -f /etc/$webserver/conf.d/sympa-soap
-			fi
-		fi
-
-	    if [ $webserver != "none" ]; then
-		    # Restarting web server if it was requested at configuration time.
-		    db_get wwsympa/webserver_restart
-		    restart="$RET"
+	if [ -f /usr/share/debconf/confmodule]; then
+		. /usr/share/debconf/confmodule
+	
+		# Don't fail here, the package might not be configured yet
+		db_get sympa/use_wwsympa || true
+		use_wwsympa="$RET"
+		db_get sympa/use_soap || true
+		use_soap="$RET"
+	
+		if [ "$use_wwsympa" = "true" -o "$use_soap" = "true" ]; then
+		    ## Remove Web server configuration
+		    db_get wwsympa/webserver_type
+		    webserver="$RET"
 		    
-		    if [ "$restart" = "true" ]; then
-				if [ -x /etc/init.d/$webserver ]; then
-					/etc/init.d/$webserver restart
+		    case $webserver in
+				"Apache")
+			    webserver="apache"
+			    ;;
+				"Apache-SSL")
+			    webserver="apache-ssl"
+			    ;;
+				"Apache 2")
+				webserver="apache2"
+				;;
+				*)
+			    webserver="none"
+			    ;;
+		    esac
+	
+			if [ "$use_soap" = "true" ]; then
+				# Remove symbolic link to webserver configuration snippet
+				link=`readlink /etc/$webserver/conf.d/sympa-soap || true`
+				if [ "$link" = "/etc/sympa/apache-soap" ]; then
+					rm -f /etc/$webserver/conf.d/sympa-soap
 				fi
-
-		        # End up with debconf
-			db_stop
-		    fi
+			fi
+	
+		    if [ $webserver != "none" ]; then
+			    # Restarting web server if it was requested at configuration time.
+			    db_get wwsympa/webserver_restart
+			    restart="$RET"
+			    
+			    if [ "$restart" = "true" ]; then
+					if [ -x /etc/init.d/$webserver ]; then
+						/etc/init.d/$webserver restart
+					fi
+	
+			        # End up with debconf
+				db_stop
+			    fi
+			fi
 		fi
 	fi
 	;;
     
     "purge")
-	db_get sympa/use_wwsympa
-	use_wwsympa="$RET"
-
-	if [ "$use_wwsympa" = "true" ]; then
-		db_input high wwsympa/remove_spool || true
-    	db_go
-	    db_get wwsympa/remove_spool
-	    remove_archives="$RET"
-    
-	    if [ "$remove_archives" = "true" ]; then
-		echo ""
-		echo "Removing archives and spool subdirectories as requested ..."
-		rm -rf /var/lib/sympa/wwsarchive 2>/dev/null || true
-		rm -rf /var/spool/sympa/wws*  2>/dev/null || true
-	    fi
-	fi
-
         # Delete the log files if purging
         # Remove aliases too.
 	rm -f /var/log/sympa.log*
@@ -112,118 +97,139 @@
         # Try to remove if empty
 	rmdir /etc/sympa          2>/dev/null || true
 
- 	db_input high sympa/remove_spool || true
-    db_go
-	db_get sympa/remove_spool
-	remove_spool="$RET"
-
-	if [ "$remove_spool" = "true" ]; then
-	    echo ""
-	    echo "Removing lists data and spool directory as requested ..."
-	    rm -rf /var/lib/sympa 2>/dev/null || true
-	    rm -rf /var/spool/sympa 2>/dev/null || true
-	fi
-
-        # Remove the database if asked for
-	db_get sympa/use_db
-	use_db="$RET"
-
-	if [ "$use_db" = "true" ]; then 
-	    
-	    # Check whether it was configured
-	    db_get sympa/db_configured
-	    db_configured="$RET"
-
-	    db_input high sympa/db_removeonpurge || true
-    	db_go
-	    db_get sympa/db_removeonpurge
-	    db_removeonpurge="$RET"
-	    
-	    if [ "$db_configured" = "true" -a "$db_removeonpurge" = "true" ]
-	    then
-	        # Get the database info
-		db_get sympa/db_type
-		db_type="$RET"
-		
-		db_get sympa/db_hostname
-		db_host="$RET"
+	if [ -f /usr/share/debconf/confmodule]; then
+		. /usr/share/debconf/confmodule
+	
+		db_get sympa/use_wwsympa
+		use_wwsympa="$RET"
+	
+		if [ "$use_wwsympa" = "true" ]; then
+			db_input high wwsympa/remove_spool || true
+	    	db_go
+		    db_get wwsympa/remove_spool
+		    remove_archives="$RET"
 	    
-		db_get sympa/db_name
-		db_name="$RET"
-		
-		db_fset sympa/db_adminpasswd seen false
-		db_input critical sympa/db_adminpasswd || true
-		db_go
-		
-		db_get sympa/db_adminpasswd
-		adminpass="$RET"
-		db_reset sympa/db_adminpasswd
-		
-		set +e
-		
-		case $db_type in
-		    "PostgreSQL")
-			echo -n "Trying to remove your PostgreSQL database ..."
-			perl -e "
-			    use DBI;
-
-			    my \$dsn = \"DBI:Pg:dbname=template1\";
-
-			    if ($db_host ne 'localhost') {
-			        \$dsn .= \";host=$db_host\";
-			    }
-
-			    # Connect to PostgreSQL
-			    my \$dbh = DBI->connect(\$dsn, \"postgres\", \"$adminpass\",
-				    		    {\"RaiseError\" => 1});
-
-			    # Remove database
-			    eval {\$dbh->do(\"DROP DATABASE $db_name\")};
-			
-			    # Remove user sympa
-			    \$dbh->do(\"DELETE FROM pg_shadow WHERE usename='sympa'\");
-
-			    \$dbh->disconnect();" >/dev/null 2>&1
-		        ;;
-
-		    "MySQL")
-			echo -n "Trying to remove your MySQL database ..."
-			perl -e "
-			    use DBI;
-
-			    my \$dsn = \"DBI:mysql:database=mysql\";
-
-			    if ($db_host ne 'localhost') {
-			        \$dsn .= \";host=$db_host\";
-			    }
-			
-			    # Connect to mysql
-			    my \$dbh = DBI->connect(\$dsn, \"root\", \"$adminpass\",
-						    {\"RaiseError\" => 1});
-
-			    # Remove the database
-			    eval {\$dbh->do(\"DROP DATABASE $db_name\")};
-
-			    # Remove user sympa
-			    \$dbh->do(\"DELETE FROM user WHERE user='sympa'\");
-			    \$dbh->do(\"DELETE FROM db WHERE user='sympa'\");
-			    \$dbh->do(\"FLUSH PRIVILEGES\");
-			
-			    \$dbh->disconnect();" >/dev/null 2>&1
-			;;
-		esac
-
-		if [ "$?" != "0" ]; then
-		    /bin/echo -e "Failed\n\n"
-		    echo "I was not able to connect to the database server."
-		    echo "You will have to remove the sympa database yourself."
-		else
-		    echo " OK"
-		    db_set "sympa/db_configured" "false"
+		    if [ "$remove_archives" = "true" ]; then
+			echo ""
+			echo "Removing archives and spool subdirectories as requested ..."
+			rm -rf /var/lib/sympa/wwsarchive 2>/dev/null || true
+			rm -rf /var/spool/sympa/wws*  2>/dev/null || true
+		    fi
+		fi
+	
+	 	db_input high sympa/remove_spool || true
+	    db_go
+		db_get sympa/remove_spool
+		remove_spool="$RET"
+	
+		if [ "$remove_spool" = "true" ]; then
+		    echo ""
+		    echo "Removing lists data and spool directory as requested ..."
+		    rm -rf /var/lib/sympa 2>/dev/null || true
+		    rm -rf /var/spool/sympa 2>/dev/null || true
+		fi
+	
+	        # Remove the database if asked for
+		db_get sympa/use_db
+		use_db="$RET"
+	
+		if [ "$use_db" = "true" ]; then 
+		    
+		    # Check whether it was configured
+		    db_get sympa/db_configured
+		    db_configured="$RET"
+	
+		    db_input high sympa/db_removeonpurge || true
+	    	db_go
+		    db_get sympa/db_removeonpurge
+		    db_removeonpurge="$RET"
+		    
+		    if [ "$db_configured" = "true" -a "$db_removeonpurge" = "true" ]
+		    then
+		        # Get the database info
+			db_get sympa/db_type
+			db_type="$RET"
+			
+			db_get sympa/db_hostname
+			db_host="$RET"
+		    
+			db_get sympa/db_name
+			db_name="$RET"
+			
+			db_fset sympa/db_adminpasswd seen false
+			db_input critical sympa/db_adminpasswd || true
+			db_go
+			
+			db_get sympa/db_adminpasswd
+			adminpass="$RET"
+			db_reset sympa/db_adminpasswd
+			
+			set +e
+			
+			case $db_type in
+			    "PostgreSQL")
+				echo -n "Trying to remove your PostgreSQL database ..."
+				perl -e "
+				    use DBI;
+	
+				    my \$dsn = \"DBI:Pg:dbname=template1\";
+	
+				    if ($db_host ne 'localhost') {
+				        \$dsn .= \";host=$db_host\";
+				    }
+	
+				    # Connect to PostgreSQL
+				    my \$dbh = DBI->connect(\$dsn, \"postgres\", \"$adminpass\",
+					    		    {\"RaiseError\" => 1});
+	
+				    # Remove database
+				    eval {\$dbh->do(\"DROP DATABASE $db_name\")};
+				
+				    # Remove user sympa
+				    \$dbh->do(\"DELETE FROM pg_shadow WHERE usename='sympa'\");
+	
+				    \$dbh->disconnect();" >/dev/null 2>&1
+			        ;;
+	
+			    "MySQL")
+				echo -n "Trying to remove your MySQL database ..."
+				perl -e "
+				    use DBI;
+	
+				    my \$dsn = \"DBI:mysql:database=mysql\";
+	
+				    if ($db_host ne 'localhost') {
+				        \$dsn .= \";host=$db_host\";
+				    }
+				
+				    # Connect to mysql
+				    my \$dbh = DBI->connect(\$dsn, \"root\", \"$adminpass\",
+							    {\"RaiseError\" => 1});
+	
+				    # Remove the database
+				    eval {\$dbh->do(\"DROP DATABASE $db_name\")};
+	
+				    # Remove user sympa
+				    \$dbh->do(\"DELETE FROM user WHERE user='sympa'\");
+				    \$dbh->do(\"DELETE FROM db WHERE user='sympa'\");
+				    \$dbh->do(\"FLUSH PRIVILEGES\");
+				
+				    \$dbh->disconnect();" >/dev/null 2>&1
+				;;
+			esac
+	
+			if [ "$?" != "0" ]; then
+			    /bin/echo -e "Failed\n\n"
+			    echo "I was not able to connect to the database server."
+			    echo "You will have to remove the sympa database yourself."
+			else
+			    echo " OK"
+			    db_set "sympa/db_configured" "false"
+			fi
+			
+			set -e
+		    fi
 		fi
-		
-		set -e
-	    fi
 	fi
 	;;
 esac

Reply via email to