[Pkg-openldap-devel] r911 - openldap/trunk/debian
Steve Langasek
vorlon at alioth.debian.org
Sun Dec 16 10:09:33 UTC 2007
Author: vorlon
Date: 2007-12-16 10:09:33 +0000 (Sun, 16 Dec 2007)
New Revision: 911
Modified:
openldap/trunk/debian/slapd.config
openldap/trunk/debian/slapd.scripts-common
Log:
several shell functions (configure_dumping, configure_ldbm_to_bdb_migration,
configure_allow_v2_binds) are specific to debconf prompting and should not
be considered "common" at all since it is an error to reference such functions
from any script other than slapd.config; so move these into the script they
belong to.
Modified: openldap/trunk/debian/slapd.config
===================================================================
--- openldap/trunk/debian/slapd.config 2007-12-16 09:55:49 UTC (rev 910)
+++ openldap/trunk/debian/slapd.config 2007-12-16 10:09:33 UTC (rev 911)
@@ -9,6 +9,72 @@
# various helper functions and $OLD_VERSION and $SLAPD_CONF
#SCRIPTSCOMMON#
+configure_allow_v2_binds() { # {{{
+# Ask if the user would like their package to support LDAPv2..
+# This was the default in older versions but we want to ask
+# for new installs too in case the user needs it..
+
+ db_input medium slapd/allow_ldap_v2 || true
+}
+# }}}
+
+configure_ldbm_to_bdb_migration() { # {{{
+# If there are any LDBM databases in use we suggest to the user to migrate
+# to the more stable and better maintained BDB backend.
+# Usage: configure_ldbm_to_bdb_migration
+
+ if [ -e "$SLAPD_CONF" ] && grep -qE \
+ -e '^moduleload[[:space:]]+back_ldbm' \
+ -e '^(database|backend)[[:space:]]+ldbm' \
+ "$SLAPD_CONF"; then
+ db_input critical slapd/migrate_ldbm_to_bdb || true
+ db_go || true
+ else
+ # Nothing to migrate
+ db_set slapd/migrate_ldbm_to_bdb false
+ fi
+}
+# }}}
+
+# ----- Configuration of LDIF dumping and reloading--------------------- {{{
+#
+# Dumping the database can have negative effects on the system we are
+# running on. If there is a lot of data dumping it might fill a partition
+# for example. Therefore we must give the user exact control over what we
+# are doing.
+
+configure_dumping() { # {{{
+# Ask the user for the configuration of the dumping component
+# Usage: configure_dumping
+
+ # Look if the user wants to migrate to the BDB backend
+ if ! database_dumping_enabled; then
+ return 0
+ fi
+
+ # Configure if and where to dump the LDAP databases
+ db_input medium slapd/dump_database || true
+ db_go || true
+ db_get slapd/dump_database
+
+ # Abort if the user does not want dumping
+ if [ "$RET" = never ]; then
+ return 0
+ fi
+
+ db_input medium slapd/dump_database_destdir || true
+ db_go || true
+
+ # If the user entered the empty value, go back to the default
+ db_get slapd/dump_database_destdir
+ if [ "$RET" = "" ]; then
+ db_reset slapd/dump_database_destdir
+ fi
+}
+
+# }}}
+# }}}
+
# Create an initial directory on fresh install
if is_initial_configuration "$@"; then
if ! want_manual_configuration; then
Modified: openldap/trunk/debian/slapd.scripts-common
===================================================================
--- openldap/trunk/debian/slapd.scripts-common 2007-12-16 09:55:49 UTC (rev 910)
+++ openldap/trunk/debian/slapd.scripts-common 2007-12-16 10:09:33 UTC (rev 911)
@@ -16,61 +16,6 @@
# for example. Therefore we must give the user exact control over what we
# are doing.
-configure_dumping() { # {{{
-# Ask the user for the configuration of the dumping component
-# Usage: configure_dumping
-
- # Look if the user wants to migrate to the BDB backend
- if ! database_dumping_enabled; then
- return 0
- fi
-
- # Configure if and where to dump the LDAP databases
- db_input medium slapd/dump_database || true
- db_go || true
- db_get slapd/dump_database
-
- # Abort if the user does not want dumping
- if [ "$RET" = never ]; then
- return 0
- fi
-
- db_input medium slapd/dump_database_destdir || true
- db_go || true
-
- # If the user entered the empty value, go back to the default
- db_get slapd/dump_database_destdir
- if [ "$RET" = "" ]; then
- db_reset slapd/dump_database_destdir
- fi
-}
-
-# }}}
-configure_ldbm_to_bdb_migration() { # {{{
-# If there are any LDBM databases in use we suggest to the user to migrate
-# to the more stable and better maintained BDB backend.
-# Usage: configure_ldbm_to_bdb_migration
-
- if [ -e "$SLAPD_CONF" ] && grep -qE \
- -e '^moduleload[[:space:]]+back_ldbm' \
- -e '^(database|backend)[[:space:]]+ldbm' \
- "$SLAPD_CONF"; then
- db_input critical slapd/migrate_ldbm_to_bdb || true
- db_go || true
- else
- # Nothing to migrate
- db_set slapd/migrate_ldbm_to_bdb false
- fi
-}
-# }}}
-configure_allow_v2_binds() { # {{{
-# Ask if the user would like their package to support LDAPv2..
-# This was the default in older versions but we want to ask
-# for new installs too in case the user needs it..
-
- db_input medium slapd/allow_ldap_v2 || true
-}
-# }}}
break_on_ldbm_to_bdb_migration_disagree() { # {{{
if [ -e "$SLAPD_CONF" ] && grep -qE \
-e '^moduleload[[:space:]]+back_ldbm' \
@@ -116,7 +61,7 @@
db_get slapd/migrate_ldbm_to_bdb
if [ "$RET" = "true" ] || dpkg --compare-versions \
- "$OLD_VERSION" lt-nl "2.4.7"; then
+ "$OLD_VERSION" lt-nl 2.4.7; then
return 0
else
return 1
More information about the Pkg-openldap-devel
mailing list