# Copyright (C) 2011 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of django-debian.
#
# django-debian is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation
#
# django-debian is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with django-debian.  If not, see <http://www.gnu.org/licenses/>.


# Source common django-debian stuff
if [ -f /usr/share/django-debian/dpkg/common ]; then
    . /usr/share/django-debian/dpkg/common
fi


_django_debian_dbc_go() {
    # Load dbconfig-common if it was requested
    if [ "$django_debian_use_dbconfig_common" = "yes" ]; then
        if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
            # Advertise support for databases that we were asked to support 
            dbc_dbtypes="$django_debian_dbtypes"
            # Source dbconfig-common stuff
            . /usr/share/dbconfig-common/dpkg/config 
            # Call dbconfig-common hook
            dbc_go $@
        fi
    fi
}


django_debian_go(){
    _django_debian_debug "starting config script: $@"

    # Setup configuration variables
    _django_debian_config $@

    # Run dbconfig-common integration
    _django_debian_dbc_go $@
}
