From f6d2531172010e200982e2a4a9e8b4f2e52299f8 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 30 Aug 2012 09:35:40 +0000 Subject: [PATCH] Provide postinst to automatically execute ngcp-update-db-schema on 2.6 systems This is supposed to help us getting the broken /usr/share/ngcp-db-schema/db_scripts/diff/9868.up script into existing 2.6 systems. Needs excessive testing, not ready for release *yet*. From: Michael Prokop --- debian/ngcp-db-schema.postinst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 debian/ngcp-db-schema.postinst diff --git a/debian/ngcp-db-schema.postinst b/debian/ngcp-db-schema.postinst new file mode 100644 index 00000000..4121ccba --- /dev/null +++ b/debian/ngcp-db-schema.postinst @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + # apply bugfix on 2.6 ngcp systems with broken db rev script + # /usr/share/ngcp-db-schema/db_scripts/diff/9868.up + # ngcp 2.5 repos provides ngcp-db-schema := 0.1.3 + # ngcp 2.6 repos provides ngcp-db-schema >= 2.6.3 + if [ -n "$2" ] && dpkg --compare-versions $2 gt 0.1.3 && dpkg --compare-versions $2 le 2.6.3 ; then + echo "Executing ngcp-update-db-schema to address 2.6 db rev script bug." + ngcp-update-db-schema + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst of ngcp-db-schema called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0