[Dbconfig-common-changes] [dbconfig-common] r295 - in trunk: . debian doc dpkg examples/db-test-multidbtype-2.0/debian examples/db-test-mysql-2.0/debian examples/db-test-mysql-2.1/debian examples/db-test-mysql-frontend-2.0/debian examples/db-test-mysql-perl-2.0/debian examples/db-test-pgsql-2.0/debian examples/db-test-pgsql-migration-2.0/debian

Sean Finney seanius at costa.debian.org
Tue Aug 15 08:27:36 CEST 2006


Author: seanius
Date: 2006-08-15 06:27:35 +0000 (Tue, 15 Aug 2006)
New Revision: 295

Modified:
   trunk/dbconfig-generate-include
   trunk/debian/changelog
   trunk/debian/control
   trunk/doc/dbconfig-common.sgml
   trunk/dpkg/common
   trunk/dpkg/postrm
   trunk/examples/db-test-multidbtype-2.0/debian/postrm
   trunk/examples/db-test-mysql-2.0/debian/postrm
   trunk/examples/db-test-mysql-2.1/debian/postrm
   trunk/examples/db-test-mysql-frontend-2.0/debian/postrm
   trunk/examples/db-test-mysql-perl-2.0/debian/postrm
   trunk/examples/db-test-pgsql-2.0/debian/postrm
   trunk/examples/db-test-pgsql-migration-2.0/debian/postrm
Log:
see changelog for details, sending this up the way.


Modified: trunk/dbconfig-generate-include
===================================================================
--- trunk/dbconfig-generate-include	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/dbconfig-generate-include	2006-08-15 06:27:35 UTC (rev 295)
@@ -56,6 +56,15 @@
 EOF
 }
 
+check_permissions(){
+	local line
+	if dpkg-statoverride --list "$outputfile" >/dev/null; then
+		line=`dpkg-statoverride --list "$outputfile"`
+		owner=`echo $line | cut -d' ' -f1,2 | tr ' ' ':'`
+		perms=`echo $line | cut -d' ' -f3`
+	fi
+}
+
 TEMP=`getopt -o af:hd::m:o:p::u::s::t::C::O:P::Uv --long help,dbuser::,dbname::,dbpass::,dbport::,dbserver::,dbtype::,output:,format:,options:,comment::,owner:,mode:,ucf,version -n $0 -- "$@"`
 
 if [ $? != 0 ] ; then usage >&2 ; exit 1 ; fi
@@ -350,9 +359,11 @@
 if [ "$outputfile" ]; then
 	if [ "$do_ucf" ]; then
 		ucf "$tmpout" "$outputfile"
+		rm -f "$tmpout"
 	else
 		mv "$tmpout" "$outputfile"
 	fi
+	check_permissions
 	[ "$owner" ] && chown $owner $outputfile
 	[ "$perms" ] && chmod $perms $outputfile
 fi

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/debian/changelog	2006-08-15 06:27:35 UTC (rev 295)
@@ -1,8 +1,13 @@
-dbconfig-common (1.8.19) UNRELEASED; urgency=low
+dbconfig-common (1.8.19) UNRELEASED; urgency=high
 
   * NOT RELEASED YET
 
   [ sean finney ]
+  * dbconfig-common and the documentation/examples were not policy complaint
+    wrt the postrm script hooks.  thanks to Anthony DeRobertis for catching
+    this before it was too late.  this fixes an RC bug report with
+    dbconfig-common, so urgency=high.  bugs may need to be filed
+    seperately against packages that used the examples verbatim.
   * incorporate the "frontend" feature for read-only packages, where
     someone may want to ask the questions but not take the actions.
     see docs for details.  thanks to Thomas Huriaux and Michael
@@ -11,8 +16,15 @@
     if there are upgrades to be applied.  thanks to Michael Ablassmeier
     for pointing this out.  closes: #379730.
   * merge debian/TODO and TODO into just TODO.
+  * dbconfig-generate-include was using tempfiles without removing
+    them afterwards.  thanks to Thijs Kinkhorst for pointing this out.
+  * change dbconfig-generate-include to respect permissions that are
+    locally modified via dpkg-statoverride.  thanks to Thijs Kinkhorst
+    and Matt Brown for realizing this.
+  * no longer depend on pwgen(1) for generating random passwords, and
+    instead use sed and cut from /dev/urandom.
 
- -- sean finney <seanius at debian.org>  Fri, 04 Aug 2006 23:01:01 -0700
+ -- sean finney <seanius at debian.org>  Tue, 15 Aug 2006 08:27:04 +0200
 
 dbconfig-common (1.8.18) unstable; urgency=low
 

Modified: trunk/debian/control
===================================================================
--- trunk/debian/control	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/debian/control	2006-08-15 06:27:35 UTC (rev 295)
@@ -7,7 +7,7 @@
 
 Package: dbconfig-common
 Architecture: all
-Depends: ucf, pwgen, ${misc:Depends}
+Depends: ucf, ${misc:Depends}
 Suggests: virtual-mysql-client | mysql-client | postgresql-client
 Description: common framework for packaging database applications
  dbconfig-common presents a policy and implementation for

Modified: trunk/doc/dbconfig-common.sgml
===================================================================
--- trunk/doc/dbconfig-common.sgml	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/doc/dbconfig-common.sgml	2006-08-15 06:27:35 UTC (rev 295)
@@ -104,6 +104,26 @@
 
 # ... rest of your code ...
 			</example>
+			<p>
+			<em>NOTE</em>: to stay compliant with Policy 7.2, you need
+			to do something slightly different in your <var>postrm</var>
+			script:
+			<example>
+#!/bin/sh
+# postrm maintainer script for foo-mysql
+
+# source debconf stuff
+if [ -f /usr/share/debconf/confmodule ]; then
+	. /usr/share/debconf/confmodule
+fi
+# source dbconfig-common stuff
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
+	. /usr/share/dbconfig-common/dpkg/postrm.mysql 
+	dbc_go foo-mysql $@
+fi
+
+# ... rest of your code ...
+			</example>
 			<p> 
 			<var>dbc_go</var> is a function defined in
 			every maintainer script hook to execute the

Modified: trunk/dpkg/common
===================================================================
--- trunk/dpkg/common	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/dpkg/common	2006-08-15 06:27:35 UTC (rev 295)
@@ -699,7 +699,7 @@
 	done
 
 	if [ ! "$dbc_dbpass" ]; then
-		dbc_dbpass=`pwgen -cn -N1 -s 12`
+		dbc_dbpass=`env LANG=C sed -n -e 's/[^[:alnum:]]//g;p;q' < /dev/urandom | cut -b1-12`
 		db_set $dbc_package/$dbc_dbtype/app-pass "$dbc_dbpass"
 		db_set $dbc_package/app-password-confirm "$dbc_dbpass"
 	fi

Modified: trunk/dpkg/postrm
===================================================================
--- trunk/dpkg/postrm	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/dpkg/postrm	2006-08-15 06:27:35 UTC (rev 295)
@@ -12,7 +12,9 @@
 	elif [ "$dbc_command" = "purge" ]; then
 		# remove the dbc configuration file
 		rm -f /etc/dbconfig-common/$dbc_package.conf || true
-		ucf -p "/etc/dbconfig-common/$dbc_package.conf" || true
+		if which ucf >/dev/null 2>&1; then
+			ucf -p "/etc/dbconfig-common/$dbc_package.conf" || true
+		fi
 		# forget everything we ever new related to debconf+dbc
 		for t in $dbc_register_templates; do
 			db_unregister $dbc_package/$t || true

Modified: trunk/examples/db-test-multidbtype-2.0/debian/postrm
===================================================================
--- trunk/examples/db-test-multidbtype-2.0/debian/postrm	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/examples/db-test-multidbtype-2.0/debian/postrm	2006-08-15 06:27:35 UTC (rev 295)
@@ -3,8 +3,12 @@
 set -e
 #set -x
 
-. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/postrm 
-dbc_go db-test-multidbtype $@
+if [ -f /usr/share/debconf/confmodule ]; then
+	. /usr/share/debconf/confmodule
+fi
+if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
+	. /usr/share/dbconfig-common/dpkg/postrm 
+	dbc_go db-test-multidbtype $@
+fi
 
 #DEBHELPER#

Modified: trunk/examples/db-test-mysql-2.0/debian/postrm
===================================================================
--- trunk/examples/db-test-mysql-2.0/debian/postrm	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/examples/db-test-mysql-2.0/debian/postrm	2006-08-15 06:27:35 UTC (rev 295)
@@ -3,13 +3,20 @@
 set -e
 #set -x
 
-. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/postrm.mysql 
-dbc_go db-test-mysql $@
+if [ -f /usr/share/debconf/confmodule ]; then
+    . /usr/share/debconf/confmodule
+fi
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
+    . /usr/share/dbconfig-common/dpkg/postrm.mysql
+    dbc_go db-test-mysql $@
+fi
 
+
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-mysql/debian-db.php
-	ucf --purge /etc/db-test-mysql/debian-db.php
+	if which ucf >/dev/null 2>&1; then
+		ucf --purge /etc/db-test-mysql/debian-db.php
+	fi
 fi
 
 #DEBHELPER#

Modified: trunk/examples/db-test-mysql-2.1/debian/postrm
===================================================================
--- trunk/examples/db-test-mysql-2.1/debian/postrm	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/examples/db-test-mysql-2.1/debian/postrm	2006-08-15 06:27:35 UTC (rev 295)
@@ -3,13 +3,20 @@
 set -e
 #set -x
 
-. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/postrm.mysql 
-dbc_go db-test-mysql $@
+if [ -f /usr/share/debconf/confmodule ]; then
+    . /usr/share/debconf/confmodule
+fi
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
+    . /usr/share/dbconfig-common/dpkg/postrm.mysql
+    dbc_go db-test-mysql $@
+fi
 
+
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-mysql/debian-db.php
-	ucf --purge /etc/db-test-mysql/debian-db.php
+	if which ucf >/dev/null 2>&1; then
+		ucf --purge /etc/db-test-mysql/debian-db.php
+	fi
 fi
 
 #DEBHELPER#

Modified: trunk/examples/db-test-mysql-frontend-2.0/debian/postrm
===================================================================
--- trunk/examples/db-test-mysql-frontend-2.0/debian/postrm	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/examples/db-test-mysql-frontend-2.0/debian/postrm	2006-08-15 06:27:35 UTC (rev 295)
@@ -3,13 +3,19 @@
 set -e
 #set -x
 
-. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/frontend.postrm.mysql 
-dbc_go db-test-mysql-frontend $@
+if [ -f /usr/share/debconf/confmodule ]; then
+	. /usr/share/debconf/confmodule
+fi
+if [ -f /usr/share/dbconfig-common/dpkg/frontend.postrm.mysql ]; then
+	. /usr/share/dbconfig-common/dpkg/frontend.postrm.mysql 
+	dbc_go db-test-mysql-frontend $@
+fi
 
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-mysql-frontend/debian-db.php
-	ucf --purge /etc/db-test-mysql-frontend/debian-db.php
+	if which ucf >/dev/null 2>&1; then
+		ucf --purge /etc/db-test-mysql-frontend/debian-db.php
+	fi
 fi
 
 #DEBHELPER#

Modified: trunk/examples/db-test-mysql-perl-2.0/debian/postrm
===================================================================
--- trunk/examples/db-test-mysql-perl-2.0/debian/postrm	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/examples/db-test-mysql-perl-2.0/debian/postrm	2006-08-15 06:27:35 UTC (rev 295)
@@ -3,12 +3,19 @@
 set -e
 #set -x
 
-. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/postrm.mysql 
-dbc_go db-test-mysql-perl $@
+if [ -f /usr/share/debconf/confmodule ]; then
+	. /usr/share/debconf/confmodule
+fi
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
+	. /usr/share/dbconfig-common/dpkg/postrm.mysql 
+	dbc_go db-test-mysql-perl $@
+fi
 
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-mysql-perl/debian-db.pm
+	if which ucf >/dev/null 2>&1; then
+		ucf -p /etc/db-test-mysql-perl/debian-db.pm
+	fi
 fi
 
 #DEBHELPER#

Modified: trunk/examples/db-test-pgsql-2.0/debian/postrm
===================================================================
--- trunk/examples/db-test-pgsql-2.0/debian/postrm	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/examples/db-test-pgsql-2.0/debian/postrm	2006-08-15 06:27:35 UTC (rev 295)
@@ -3,8 +3,12 @@
 set -e
 #set -x
 
-. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/postrm.pgsql 
+if [ -f /usr/share/debconf/confmodule ]; then
+	. /usr/share/debconf/confmodule
+fi
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql  ]; then
+	. /usr/share/dbconfig-common/dpkg/postrm.pgsql 
+fi
 dbc_go db-test-pgsql $@
 
 #DEBHELPER#

Modified: trunk/examples/db-test-pgsql-migration-2.0/debian/postrm
===================================================================
--- trunk/examples/db-test-pgsql-migration-2.0/debian/postrm	2006-08-14 06:32:45 UTC (rev 294)
+++ trunk/examples/db-test-pgsql-migration-2.0/debian/postrm	2006-08-15 06:27:35 UTC (rev 295)
@@ -3,8 +3,12 @@
 set -e
 #set -x
 
-. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/postrm.pgsql 
+if [ -f /usr/share/debconf/confmodule ]; then
+	. /usr/share/debconf/confmodule
+fi
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then
+	. /usr/share/dbconfig-common/dpkg/postrm.pgsql 
+fi
 dbc_go db-test-pgsql-migration $@
 
 #DEBHELPER#




More information about the Dbconfig-common-changes mailing list