[Pkg-corba-commits] r36 - in /trunk/omniorb4/debian: omniorb4-nameserver.postrm omniorb4-nameserver.preinst
flub-guest at users.alioth.debian.org
flub-guest at users.alioth.debian.org
Sun Oct 21 22:39:52 UTC 2007
Author: flub-guest
Date: Sun Oct 21 22:39:51 2007
New Revision: 36
URL: http://svn.debian.org/wsvn/pkg-corba/?sc=1&rev=36
Log:
* Add preinst script to move the omniNames database to the new
location on an upgrade from a previous version.
* Update postinst script to revert the omniNames database move in case
the installation fails.
Added:
trunk/omniorb4/debian/omniorb4-nameserver.preinst
Modified:
trunk/omniorb4/debian/omniorb4-nameserver.postrm
Modified: trunk/omniorb4/debian/omniorb4-nameserver.postrm
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4-nameserver.postrm?rev=36&op=diff
==============================================================================
--- trunk/omniorb4/debian/omniorb4-nameserver.postrm (original)
+++ trunk/omniorb4/debian/omniorb4-nameserver.postrm Sun Oct 21 22:39:51 2007
@@ -5,13 +5,34 @@
LIBDIR=/var/lib/omniorb4/
LOGFILE=/var/log/omniorb4-nameserver.log
+OLDLIBDIR=/var/log/
+DBFILE=$(uname -n).log
+BAKFILE=$(uname -n).bak
case "$1" in
purge)
rm -rf $LIBDIR || /bin/true
rm -rf $LOGFILE || /bin/true
;;
- remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ abort-install|abort-upgrade)
+ # The DB files could have been moved, move them back.
+ # See preinst script for more details.
+ case $2 in
+ 4.0.6-*|4.0.7-*)
+ if [ -f $LIBDIR/$DBFILE ]; then
+ mv $LIBDIR/$DBFILE $OLDLIBDIR/$DBFILE
+ fi
+ if [ -f $LIBDIR/$BAKFILE ]; then
+ mv $LIBDIR/$BAKFILE $OLDLIBDIR/$BAKFILE
+ fi
+ rmdir $LIBDIR || /bin/true
+ ;;
+ *)
+ /bin/true
+ ;;
+ esac
+ ;;
+ remove|upgrade|failed-upgrade|disappear)
/bin/true
;;
*)
Added: trunk/omniorb4/debian/omniorb4-nameserver.preinst
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4-nameserver.preinst?rev=36&op=file
==============================================================================
--- trunk/omniorb4/debian/omniorb4-nameserver.preinst (added)
+++ trunk/omniorb4/debian/omniorb4-nameserver.preinst Sun Oct 21 22:39:51 2007
@@ -1,0 +1,56 @@
+#! /bin/sh
+# preinst script for omniorb4-nameserver
+
+
+set -e
+
+
+LIBDIR=/var/lib/omniorb4/
+OLDLIBDIR=/var/log/
+DBFILE=$(uname -n).log
+BAKFILE=$(uname -n).bak
+
+
+case "$1" in
+ install|upgrade)
+ # If $2 is 4.0.6-* (or 4.0.7-* to be kind to ubuntu...) then
+ # we need to move the DB to the new location. This might work
+ # for earlier versions too but I don't know and Debian does
+ # only support old-stable -> stable upgrades anyway.
+ case $2 in
+ 4.0.6-*|4.0.7-*)
+ if [ -f $OLDLIBDIR/$DBFILE ]; then
+ test -d $LIBDIR || mkdir -p $LIBDIR
+ mv $OLDLIBDIR/$DBFILE $LIBDIR/$DBFILE
+ fi
+ if [ -f $OLDLIBDIR/$BAKFILE ]; then
+ test -d $LIBDIR || mkdir -p $LIBDIR
+ mv $OLDLIBDIR/$BAKFILE $LIBDIR/$BAKFILE
+ fi
+ ;;
+ "")
+ /bin/true
+ *)
+ # This might be a little harsh. --flub
+ echo "upgrading from unkown version \`$2'" >&2
+ exit 1
+ esac
+ ;;
+
+ abort-upgrade)
+ /bin/true
+ ;;
+
+ *)
+ echo "preinst called with unkown argument \`$1'" >&2
+ exit 1
+esac
+
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+
+exit 0
More information about the Pkg-corba-commits
mailing list