[Pkg-openldap-devel] r1223 - openldap/trunk/debian

vorlon at alioth.debian.org vorlon at alioth.debian.org
Sun Apr 19 23:03:05 UTC 2009


Author: vorlon
Date: 2009-04-19 23:03:05 +0000 (Sun, 19 Apr 2009)
New Revision: 1223

Modified:
   openldap/trunk/debian/slapd.scripts-common
Log:
revert the slapd.scripts-common change, this isn't ready yet

Modified: openldap/trunk/debian/slapd.scripts-common
===================================================================
--- openldap/trunk/debian/slapd.scripts-common	2009-04-19 21:49:03 UTC (rev 1222)
+++ openldap/trunk/debian/slapd.scripts-common	2009-04-19 23:03:05 UTC (rev 1223)
@@ -160,8 +160,7 @@
 	for db in `get_database_list`; do
 		suffix=`get_suffix $db`
 		dbdir=`get_directory $db`
-		if ! is_empty_dir "$dbdir" &&
-		   ! dir_only_contains_DB_CONFIG "$dbdir"; then
+		if ! is_empty_dir "$dbdir"; then
 			echo >&2 \
 			  "  Directory $dbdir for $suffix not empty, aborting."
 			exit 1
@@ -170,16 +169,13 @@
 		file="$dir/$suffix.ldif"
 		echo -n "  - directory $suffix... " >&2
 
-		# If there is no DB_CONFIG file in the database dir, but
-		# an old DB_CONFIG file in the backup dir,
-		# restore it before running slapadd
-		if [ ! -e "$dbdir"/DB_CONFIG ]; then
-			backupdir=`compute_backup_path -n "$dbdir" "$suffix"`
-			if [ -e "$backupdir"/DB_CONFIG ]; then
-				cp -a "$backupdir"/DB_CONFIG "$dbdir"/
-			else
-				copy_example_DB_CONFIG "$dbdir"/
-			fi
+		# If there is an old DB_CONFIG file, restore it before
+		# running slapadd
+		backupdir=`compute_backup_path -n "$dbdir" "$suffix"`
+		if [ -e "$backupdir"/DB_CONFIG ]; then
+			cp -a "$backupdir"/DB_CONFIG "$dbdir"/
+		else
+			copy_example_DB_CONFIG "$dbdir"/
 		fi
 
 		capture_diagnostics slapadd -q -b "$suffix" -l "$file" \
@@ -1018,7 +1014,7 @@
 # Check if a path refers to an empty directory
 # Usage: if is_empty_dir "$dir"; then ... fi
 
-	output=`find "$1" -maxdepth 0 -type d -empty 2>/dev/null`
+	output=`find "$1" -type d -maxdepth 0 -empty 2>/dev/null`
   	if [ "$output" ]; then
     		return 0
   	else
@@ -1028,24 +1024,6 @@
 
 # }}}
 
-# }}}
-dir_only_contains_DB_CONFIG() {							# {{{
-# Check if a path refers to a directory
-# that is empty or contains only DB_CONFIG
-# Usage: if dir_only_contains_DB_CONFIG "$dir"; then ... fi
-
-	test -d "$1" || return 1
-
-	output=`find "$1" -mindepth 1 -maxdepth 1 2>/dev/null | grep -v /DB_CONFIG$`
-  	if [ "$output" ]; then
-    		return 1
-  	else
-    		return 0
-  	fi
-}
-
-# }}}
-
 # ===== Global variables ================================================ {{{
 #
 # At some points we need to know which version we are upgrading from if




More information about the Pkg-openldap-devel mailing list