[Dbconfig-common-changes] [dbconfig-common] r287 - in trunk: debian dpkg

Sean Finney seanius at costa.debian.org
Sat Aug 5 22:27:45 CEST 2006


Author: seanius
Date: 2006-08-05 20:27:45 +0000 (Sat, 05 Aug 2006)
New Revision: 287

Modified:
   trunk/debian/changelog
   trunk/dpkg/config
   trunk/dpkg/postinst
Log:
only ask for admin pw if upgrades are necessary.  NEEDS CHECKING

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-08-05 20:08:06 UTC (rev 286)
+++ trunk/debian/changelog	2006-08-05 20:27:45 UTC (rev 287)
@@ -7,6 +7,9 @@
     someone may want to ask the questions but not take the actions.
     see docs for details.  thanks to Thomas Huriaux and Michael
     Ablassmeier for the prompting on this one.  closes: #373188.
+  * when doing upgrades, only ask for the administrative password
+    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.
 
  -- sean finney <seanius at debian.org>  Fri, 04 Aug 2006 23:01:01 -0700

Modified: trunk/dpkg/config
===================================================================
--- trunk/dpkg/config	2006-08-05 20:08:06 UTC (rev 286)
+++ trunk/dpkg/config	2006-08-05 20:27:45 UTC (rev 287)
@@ -42,6 +42,13 @@
 		userdb_prio="low"
 	fi
 
+	# and if they're upgrading from any previous version, we *may*
+	# not need to ask for an admin password.  we can't tell at this
+	# point because the upgrade files are likely not unpacked at
+	# this point, so we will instead ask later in the postinst.
+	if [ "$dbc_oldversion" ]; then
+		need_adminpw="false"
+	fi
 
 	# the first question we ask will differ depending on how we're invoked
 	if [ "$dbc_command" = "configure" ]; then

Modified: trunk/dpkg/postinst
===================================================================
--- trunk/dpkg/postinst	2006-08-05 20:08:06 UTC (rev 286)
+++ trunk/dpkg/postinst	2006-08-05 20:27:45 UTC (rev 287)
@@ -2,7 +2,7 @@
 ### load up common variables and functions
 ###
 dbc_go(){
-	local prev_dbc_upgrade importing_from_non_dbc upgrading reconfiguring f tsubstfile upgrades_pending dumpfile _dbc_asuser reinstall
+	local importing_from_non_dbc upgrading reconfiguring f tsubstfile upgrades_pending dumpfile _dbc_asuser reinstall
 
 	. /usr/share/dbconfig-common/dpkg/common
 	dbc_debug "(postinst) dbc_go() $@"
@@ -139,7 +139,6 @@
 			# if there are any upgrades to be applied
 			if [ "$upgrades_pending" ]; then
 				# ask if they want our help in the process at all
-				prev_dbc_upgrade="$dbc_upgrade"
 				db_set $dbc_package/dbconfig-upgrade $dbc_upgrade
 				db_fset $dbc_package/dbconfig-upgrade seen false
 				db_input high $dbc_package/dbconfig-upgrade || true
@@ -149,9 +148,12 @@
 				# and if they don't want our help, we'll go away
 				if [ "$dbc_upgrade" != "true" ]; then return 0; fi
 
-				###
-				### perform a few sanity checks on the data
-				###
+				# get the admin password if it's needed
+				if [ ! "$dbc_frontend" ]; then
+					if [ ! "$dbc_dbtype" = "pgsql" ] || [ ! "$dbc_authmethod_admin" = "ident" ]; then
+						dbc_get_admin_pass
+					fi
+				fi
 
 				# this is the file into which upgrade backups go
 				dumpfile=/var/cache/dbconfig-common/backups/${dbc_package}_${dbc_oldversion}.$dbc_dbtype	




More information about the Dbconfig-common-changes mailing list