[Dbconfig-common-devel] dbconfig-common/dpkg config,1.20,1.21

seanius@haydn.debian.org seanius@haydn.debian.org


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

Modified Files:
	config 
Log Message:
silently exit if dbc_load_include is set but the includefile is not yet unpacked

Index: config
===================================================================
RCS file: /cvsroot/dbconfig-common/dbconfig-common/dpkg/config,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- config	19 May 2005 01:48:33 -0000	1.20
+++ config	21 May 2005 16:23:35 -0000	1.21
@@ -43,6 +43,18 @@
 		## start new dbc upgrade section
 		##
 
+		# if dbc_load_include is set but the file doesn't exist
+		# then let's silently exit because that would imply
+		# we're running before the file is from the latest
+		# version of the package which has not yet been unpacked
+		if [ "$dbc_load_include" ]; then
+			iformat=`echo $dbc_load_include | cut -d: -f1`
+			ifile=`echo $dbc_load_include | cut -d: -f2-`
+			if [ ! -f "$ifile" ]; then
+				return 0
+			fi
+		fi
+
 		if dpkg --compare-versions "$dbc_first_version" gt "$dbc_oldversion"; then
 			db_input high $dbc_package/import-oldsettings || true
 			##
@@ -51,8 +63,6 @@
 			## skipped 
 			##
 			if [ "$dbc_load_include" ]; then
-				iformat=`echo $dbc_load_include | cut -d: -f1`
-				ifile=`echo $dbc_load_include | cut -d: -f2-`
 				eval `dbconfig-load-include $dbc_load_include_args -f $iformat $ifile`
 				for f in database-type $dbc_dbtype/method remote/host remote/newhost remote/port pgsql/authmethod-admin pgsql/authmethod-user $dbc_dbtype/admin-user db/app-user db/dbname; do
 					db_fset $dbc_package/$f seen true || true