3
# Summary of how this script is called:
4
# . new-preinst install
5
# . new-preinst install old-version
6
# . new-preinst upgrade old-version
5
# summary of how this script can be called:
6
# * <new-preinst> `install'
7
# * <new-preinst> `install' <old-version>
8
# * <new-preinst> `upgrade' <old-version>
9
# * <old-preinst> `abort-upgrade' <new-version>
10
# for details, see http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
8
15
export BUGZILLA_ETCDIR="/etc/bugzilla3"
9
16
export BUGZILLA_VARDIR="/var/lib/bugzilla3"
44
43
if [ -e $file ]; then
46
44
replace_file "$file" "$BUGZILLA_ETCDIR/params"
51
##############################################################
53
#############################################################
49
trap "rm $tmpf" EXIT QUIT
59
51
if [ "$mode" = "upgrade" ]; then
62
54
# Upgrade the 2.16 packages and older
63
params_216="$BUGZILLA_DATADIR/params"
64
55
if [ -n "$version" ] && dpkg --compare-versions "$version" lt 2.16.7-6; then
65
debug "Upgrading $version"
66
upgrade_params_file $params_216
56
upgrade_params_file "$BUGZILLA_DATADIR/params"
69
59
# Upgrade previous 2.18 packages
70
params_218="/usr/share/bugzilla3/web/data/params"
71
60
if [ -n "$version" ] && dpkg --compare-versions "$version" lt 2.18-4; then
72
debug "Upgrading $version"
73
upgrade_params_file $params_218
61
upgrade_params_file "$BUGZILLA_SHAREDIR/web/data/params"
76
64
# Upgrade previous 2.22 package
77
params_222="/usr/share/bugzilla3/debian/params"
78
65
if [ -n "$version" ] && dpkg --compare-versions "$version" lt 2.22.1; then
79
debug "Upgrading $version"
80
upgrade_params_file $params_222
66
upgrade_params_file "$BUGZILLA_SHAREDIR/debian/params"
83
69
if [ -n "$version" -a -e "$BUGZILLA_ETCDIR/pre-checksetup.d/55localyui" ] && dpkg --compare-versions "$version" lt 3.2.5.0-2; then
87
73
rm "$BUGZILLA_ETCDIR/pre-checksetup.d/55localyui"
77
# Migrate $BUGZILLA_ETCDIR/params:
78
# urlbase: /cgi-bin/bugzilla3 -> /bugzilla3
79
# url_docbase: /docs/bugzilla3-doc/%lang%/html -> /doc/bugzilla3-doc/%lang%/html
80
if test -s "$BUGZILLA_ETCDIR/params" && dpkg --compare-versions "$version" lt "3.0.10.0-1" || ( dpkg --compare-versions "$version" ge "3.2" && dpkg --compare-versions "$version" lt "3.2.5.0-1" ); then
81
sed -e 's,/cgi-bin/bugzilla3,/bugzilla3,g' \
82
-e 's,/docs/bugzilla3-doc/%lang%/html/,/doc/bugzilla3-doc/%lang%/html/,g' \
83
"$BUGZILLA_ETCDIR/params" >"$tmpf"
84
cat "$tmpf" >"$BUGZILLA_ETCDIR/params"
87
# Introduction of dpkg-statsoverride support:
88
# Revert previous file access rights/modes.
89
if dpkg --compare-versions "$version" lt "3.0.10.0-1" || ( dpkg --compare-versions "$version" ge "3.2" && dpkg --compare-versions "$version" lt "3.2.5.0-3" ); then
90
chown -R root:root "$BUGZILLA_VARDIR"
91
chmod -R 0755 "$BUGZILLA_VARDIR"