[pkg-bacula-commits] [bacula] 01/02: removed more obsolete code from common-functions.dpkg, whitespace cleanup and spelling errors

Carsten Leonhardt leo at moszumanska.debian.org
Tue Sep 6 16:50:18 UTC 2016


This is an automated email from the git hooks/post-receive script.

leo pushed a commit to branch migrate-files
in repository bacula.

commit 97712e183862c1764338ea5ac9556a85f731a717
Author: Carsten Leonhardt <leo at debian.org>
Date:   Tue Sep 6 17:46:00 2016 +0200

    removed more obsolete code from common-functions.dpkg,
    whitespace cleanup and spelling errors
---
 debian/additions/common-functions.dpkg | 46 ++++------------------------------
 1 file changed, 5 insertions(+), 41 deletions(-)

diff --git a/debian/additions/common-functions.dpkg b/debian/additions/common-functions.dpkg
index 3083035..976324b 100644
--- a/debian/additions/common-functions.dpkg
+++ b/debian/additions/common-functions.dpkg
@@ -45,8 +45,6 @@ EOF
     fi
 }
 
-
-
 #
 # Function to substitute variables into template
 # Usage: substitute <template> <output>
@@ -73,33 +71,11 @@ substitute() {
   $SEDCMD "$TEMPLATE" >"$DEST"
 }
 
-
-
-#
-# Function to check if config already registered by the same package for
-# other database type.
-# Usage: config_from_other_dbtype <package> <config>
-#
-
-config_from_other_dbtype() {
-  local PACKAGE CONFIG base_package_name regex
-  PACKAGE="$1"
-  CONFIG="$2"
-
-  base_package_name=$(echo "$PACKAGE" |sed -Ee 's/-(mysql|pgsql|sqlite3)$//')
-  regex="^$CONFIG:$base_package_name-(mysql|pgsql|sqlite3):"
-
-  ucfq -w "$CONFIG" |egrep -q "$regex"
-}
-
-
-
 #
 # Function to install config file from template
 # Usage: install_config <package> <config name> [ <template> ]
 #
-# use substitute() for generate config
-# use config_from_other_dbtype() for force reregister file with ucf
+# use substitute() to generate config
 # install and register generated file with ucf
 #
 
@@ -115,7 +91,6 @@ install_config() {
   fi
   tempfile=`tempfile`
 
-
   dpkg_conffile_md5sum="$(dpkg-query -W -f='${Conffiles}' \"$PACKAGE\" \
     2>/dev/null |sed -ne "\' $CONFIG ' { s/ obsolete$//; s/.* //; p }")"
 
@@ -130,27 +105,17 @@ install_config() {
 
   substitute "$TEMPLATE" "$tempfile"
   ucf --debconf-ok --three-way "$tempfile" "$CONFIG"
-
-  # if config installed by the same package for other
-  # database type, we need force reregister it.
-  if config_from_other_dbtype "$PACKAGE" "$CONFIG"; then
-    ucfr -f "$PACKAGE" "$CONFIG"
-  else
-    ucfr "$PACKAGE" "$CONFIG"
-  fi
+  ucfr "$PACKAGE" "$CONFIG"
 
   rm -f "$tempfile" "$tempfile.md5sum"
 }
 
-
-
 #
 # Function to setup /etc/default/*
-# Usage: call from postins script "setup_etc_default <package> $@"
+# Usage: call from postinst script "setup_etc_default <package> $@"
 #
-# if there is fresh install, generate default /etc/default/* file
-# if there is upgrade from old version, then set ENABLED=no if /etc/bacula/do_not_run present
-# if there is upgrade from recent version, then preserve ENABLED, ARGS and CONFIG variables/
+# on a fresh install, generate default /etc/default/* file
+# on an upgrade, preserve ENABLED, ARGS and CONFIG variables/
 #
 setup_etc_default() {
     local PACKAGE SERVICE ARGS DEFAULT_ARGS ENABLED CONFIG DEFAULTS tempfile
@@ -178,7 +143,6 @@ setup_etc_default() {
             return
     esac
 
-
     ENABLED="yes"
     CONFIG="/etc/bacula/$SERVICE.conf"
     DEFAULTS="/etc/default/$SERVICE"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bacula/bacula.git



More information about the pkg-bacula-commits mailing list