File: postinst

package info (click to toggle)
moin 1.9.9-1+deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 76,024 kB
  • sloc: python: 143,896; java: 10,704; php: 2,385; perl: 1,574; xml: 371; makefile: 214; sh: 81; sed: 5
file content (40 lines) | stat: -rw-r--r-- 937 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

set -e

rename_conffile_commit () {
# syntax: rename_conffile_commit filename
#
# Complete the renaming of a conffile "filename" that has been renamed.
#
# Call this function from a postinst script after having used
# rename_conffile_prepare() in the preinst.

	#local conffile

	# validate arguments
	if [ $# -ne 1 ]; then
		echo "$0: usage error: rename_conffile_commit() called with wrong number of arguments (expected 1, got $#)." >&2
		exit 2
	fi

	_conffile="$1"

	# If the temporary file created by rename_conffile_prepare() exists, remove
	# it.
	if [ -e "$_conffile.python-moinmoin.moved" ]; then
		rm "$_conffile.python-moinmoin.moved"
	fi
}

#DEBHELPER#

rename_conffile_commit /etc/moin/moinmaster.py

# Change this when some incompatible change is made that requires
# rebuilding all wikis.
firstcompat=1.9.0~

if [ "$1" = configure ] && dpkg --compare-versions "$2" lt "$firstcompat"; then
	moin-mass-migrate
fi