[Dbconfig-common-changes] [dbconfig-common/sid] fix for #514347: opt out from d-g-i on manual installs

sean finey seanius at debian.org
Sun Feb 8 22:11:17 UTC 2009


see the documentation for the variable dbc_dgi_on_manual.
---
 debian/changelog         |    3 +++
 doc/dbconfig-common.sgml |    4 ++++
 dpkg/common              |    6 +++++-
 dpkg/postinst            |    3 +++
 4 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 0a1e743..d39fbc5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ dbconfig-common (1.8.41) UNRELEASED; urgency=low
   * NOT RELEASED YET
   * Fix for a location in the code where ucf was not being called with the
     now requisite --debconf-ok (closes: #513753).
+  * New postinst maintainer variable: dbc_dgi_on_manual.  Allows the
+    packager to disable creation of the d-g-i generated files when the
+    admin opts for manual installation (closes: #514347).
   * Incorporate suggested rewrite of package description and debconf templates 
     from Christian Perrier and the debian-l10n-english contributors 
     (closes: #513909).
diff --git a/doc/dbconfig-common.sgml b/doc/dbconfig-common.sgml
index 82d2857..8fa3925 100644
--- a/doc/dbconfig-common.sgml
+++ b/doc/dbconfig-common.sgml
@@ -492,6 +492,10 @@ fi
 				<item>arguments passed directly to
 				<var>dbconfig-generate-include</var> (defaults
 				to: empty)
+			<tag>dbc_dgi_on_manual (used in: <var>postinst</var>)
+				<item>control whether config files should be generated by
+				<var>dbconfig-generate-include</var> when the admin opts for
+        manual installation (defaults to: true)
 			<tag>dbc_first_version (used in: <var>config</var>,<var>postinst</var>)
 				<item>the first version in which
 				<package>dbconfig-common</package> was introduced in the
diff --git a/dpkg/common b/dpkg/common
index 1609c51..3d83886 100644
--- a/dpkg/common
+++ b/dpkg/common
@@ -512,7 +512,11 @@ EOF
 	mkdir -p "`dirname \"$dbc_packageconfig\"`"
 	ucf --debconf-ok "$tfile" "$dbc_packageconfig"
 	rm -f "$tfile"
-	if [ "$dbc_generate_include" ]; then
+  # generate the requested d-g-i config files unless it's a manual install
+  # and we've been explicitly told to avoid doing this
+  if [ "$dbc_install" != "true" ] && [ "$dbc_dgi_on_manual" != "true" ]; then
+    return 0
+  elif [ "$dbc_generate_include" ]; then
 		if [ "$dbc_generate_include_owner" ]; then
 			dbc_generate_include_args="$dbc_generate_include_args -O $dbc_generate_include_owner"
 		fi
diff --git a/dpkg/postinst b/dpkg/postinst
index 4811155..2fbf31d 100644
--- a/dpkg/postinst
+++ b/dpkg/postinst
@@ -7,6 +7,9 @@ dbc_go(){
 	. /usr/share/dbconfig-common/dpkg/common
 	_dbc_debug "(postinst) dbc_go() $@"
 	dbc_config $@
+  # the maintainer has the option of telling us to not generate include files
+  # for manual installs in case it changes the apps behavior to have the file
+  dbc_dgi_on_manual=${dbc_dgi_on_manual:-true}
 
 	###
 	### begin main code execution
-- 
1.5.6.5




More information about the Dbconfig-common-changes mailing list