Oops

On Mon, May 18, 2020 at 5:12 PM Ryan Tandy <r...@nardis.ca> wrote:
>
> Control: tag -1 moreinfo
>
> Hi Andreas, I think the patch is missing... :)

Here you go:
diff --git a/debian/slapd.scripts-common b/debian/slapd.scripts-common
index 9af6262f59..e11d2272de 100644
--- a/debian/slapd.scripts-common
+++ b/debian/slapd.scripts-common
@@ -365,6 +365,12 @@ compute_backup_path() {							# {{{
 	id="$OLD_VERSION"
 	[ -n "$id" ] || id=`date +%Y%m%d-%H%M%S`
 	target="/var/backups/$basedn-$id.ldapdb"
+	# Configuration via dpkg-reconfigure.
+	# The backup directory already exists when reconfigured
+	# twice or more: append a timestamp.
+	if [ -e "${target}" ] && ([ "$MODE" = reconfigure ] || [ "$DEBCONF_RECONFIGURE" ]); then
+			 target="$target-`date +%Y%m%d-%H%M%S`"
+	fi
 	if [ -e "$target" ] && [ -z "$ok_exists" ]; then
 		echo >&2
 		echo >&2 "  Backup path $target exists. Giving up..."

Reply via email to