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

vorlon at alioth.debian.org vorlon at alioth.debian.org
Wed Jul 29 08:50:25 UTC 2009


Author: vorlon
Date: 2009-07-29 08:50:24 +0000 (Wed, 29 Jul 2009)
New Revision: 1232

Modified:
   openldap/trunk/debian/slapd.scripts-common
Log:
revert unintended change to slapd.scripts-common

Modified: openldap/trunk/debian/slapd.scripts-common
===================================================================
--- openldap/trunk/debian/slapd.scripts-common	2009-07-29 01:05:46 UTC (rev 1231)
+++ openldap/trunk/debian/slapd.scripts-common	2009-07-29 08:50:24 UTC (rev 1232)
@@ -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