debian/cubicweb-ctl.postinst
author Alexandre Fayolle <alexandre.fayolle@logilab.fr>
Mon, 23 Aug 2010 08:46:24 +0200
branchstable
changeset 6133 6f3eabbbdf2e
parent 1448 62f099f0916f
child 10559 5821ae654dfd
permissions -rw-r--r--
use iter_and_commit in example
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
#! /bin/sh -e
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
case "$1" in
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     4
    configure|abort-upgrade|abort-remove|abort-deconfigure)
462
c6e313c7a2e0 use 99 as default sequence number in runlevel
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 241
diff changeset
     5
        update-rc.d cubicweb defaults 99 >/dev/null
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     6
    ;;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     7
    *)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
        echo "postinst called with unknown argument \`$1'" >&2
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     9
        exit 1
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    10
    ;;
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    11
esac
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    12
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    13
if [ "$1" = configure ]; then
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    14
    # XXX bw compat: erudi -> cubicweb migration
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    15
    if [ -e "/etc/erudi.d/" ]; then
1448
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    16
      mv /etc/erudi.d/* /etc/cubicweb.d/ && (
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    17
	  echo 'moved /etc/erudi.d/* to /etc/cubicweb.d/'
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    18
	  sed -i s/ginco/cubicweb/g /etc/*/*.py
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    19
	  sed -i s/erudi/cubicweb/ */*.conf
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    20
	  ) || true # empty dir
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    21
    fi
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    22
    if [ -e "/var/log/erudi/" ]; then
1448
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    23
      mv /var/log/erudi/* /var/log/cubicweb/ && (
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    24
	  echo 'moved /var/log/erudi/* to /var/log/cubicweb/'
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    25
	  ) || true # empty dir
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    26
    fi
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    27
    if [ -e "/var/lib/erudi/backup" ]; then
1448
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    28
      mv /var/lib/erudi/backup/* /var/lib/cubicweb/backup/ && (
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    29
	  echo 'moved /var/lib/erudi/backup/* to /var/lib/cubicweb/backup/'
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    30
	  ) || true # empty dir
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    31
    fi
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    32
    if [ -e "/var/lib/erudi/instances" ]; then
1448
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    33
      mv /var/lib/erudi/instances/* /var/lib/cubicweb/instances/ && (
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    34
	  echo 'moved /var/lib/erudi/instances/* to /var/lib/cubicweb/instances/'
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    35
	  ) || true # empty dir
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    36
    fi
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    37
fi
1448
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    38
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    39
#DEBHELPER#
1448
62f099f0916f deals with empty erudi directories
sylvain.thenault@logilab.fr
parents: 462
diff changeset
    40
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    41
exit 0