[pkg-bacula-commits] [bacula] 01/01: Let debian/scripts/install-dbconfig detect an unsupported bacula database version update and abort the build if needed
Carsten Leonhardt
leo at moszumanska.debian.org
Mon Mar 20 23:01:17 UTC 2017
This is an automated email from the git hooks/post-receive script.
leo pushed a commit to branch master
in repository bacula.
commit c4f714e8001fdad581136ebcb17e6eebc5af88d1
Author: Carsten Leonhardt <leo at debian.org>
Date: Tue Mar 21 00:00:14 2017 +0100
Let debian/scripts/install-dbconfig detect an unsupported bacula
database version update and abort the build if needed
---
debian/TODO | 3 ---
debian/changelog | 2 ++
debian/scripts/install-dbconfig | 15 +++++++++++++++
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/debian/TODO b/debian/TODO
index bdd7697..a28d1e5 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -11,9 +11,6 @@ Normal:
renames while installing)
* Check Depends on SQL-client-libraries, they might be obsoleted by dbconfig-*sql*
* Check if bacula-director-pgsql suggesting postgresql-contrib is useful
- * Automatically detect the introduction of a new database version and
- warn or abort package build:
- test $(grep "VersionId.*VALUES" src/cats/make_sqlite3_tables.in | sed 's/.*VALUES .\([0-9]*\).*/\1/') = 15
* Investigate if we can obsolete the bacula-director-db packages
by using dbconfig-common better.
* Ask lintian maintainers about "unused-shlib-entry-in-control-file libbaccats"
diff --git a/debian/changelog b/debian/changelog
index 3ec505b..95935fc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ bacula (7.4.7+dfsg-1) experimental; urgency=medium
upstream. Upstream no longer officially supports SQLite3, added a news
entry about the fact and a note in the package description of
bacula-director-sqlite3. (Closes: #854684)
+ * Let debian/scripts/install-dbconfig detect an unsupported bacula
+ database version update and abort the build if needed
--
diff --git a/debian/scripts/install-dbconfig b/debian/scripts/install-dbconfig
index 539c81b..55f4c79 100755
--- a/debian/scripts/install-dbconfig
+++ b/debian/scripts/install-dbconfig
@@ -108,3 +108,18 @@ for db in $variants; do
mkdir -p `dirname $targetfile`
awk -v version=ignore -f $extractor $sourcefile >> $targetfile
done
+
+# check if this script needs to be updated
+for db in $variants; do
+ set_longdb
+
+ sourcefile="src/cats/make_"$longdb"_tables"
+ # this looks where the current database version is inserted in the
+ # make_(db)_tables script and extracts it
+ current_bacula_db_version=`sed -n 's/INSERT INTO Version (VersionId) VALUES (\([0-9]*\));/\1/ip' $sourcefile`
+ # dbtarget was counted up one time too many
+ if [ $current_bacula_db_version -ne $((dbtarget -1)) ]; then
+ echo "error: unsupported database version $current_bacula_db_version, please update $0!"
+ exit 1
+ fi
+done
--
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