File: pre_distupgrade_exceptions

package info (click to toggle)
piuparts 1.6.0
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 72,532 kB
  • sloc: python: 8,240; sh: 4,367; makefile: 171
file content (202 lines) | stat: -rwxr-xr-x 5,734 bytes parent folder | download | duplicates (3)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#!/bin/sh
set -e

log_debug() {
	echo "Debug: piuparts exception for package $PIUPARTS_OBJECTS"
}

is_installed()
{
	local pkg="$1"
	dpkg-query -s "$pkg" >/dev/null 2>&1 || return 1
	local status="$(dpkg-query -W -f '${Status}' $pkg)"
	test "$status" != "unknown ok not-installed" || return 1
	test "$status" != "deinstall ok config-files" || return 1
	return 0
}

dbconfig_enable_purge()
{
	log_debug
	echo "$1 $1${2+/$2}/dbconfig-remove boolean true" | debconf-set-selections
	echo "$1 $1${2+/$2}/purge boolean true" | debconf-set-selections
}

if [ "$PIUPARTS_DISTRIBUTION_NEXT" = "squeeze" ]; then

	case ${PIUPARTS_OBJECTS%%=*} in
		crm114)
			#562946
			log_debug
			echo "crm114 crm114/forceupgrade boolean true" | debconf-set-selections
			;;
		slapd|\
		slapd-dbg)
			# squeeze postinst wants to restore a backup from lenny that was never created
			log_debug
			dpkg --purge slapd slapd-dbg
			;;
	esac

	# squeeze does not properly upgrade adduser.conf, so generate a new one
	if [ -f /etc/adduser.conf ]; then
		md5="$(md5sum /etc/adduser.conf | awk '{ print $1 }')"
		# 5b577c9cb18e4852fc7e45830d230ec1: adduser/lenny pristine
		# 28928669e36f1ab616dfda39af3d79a7: adduser/lenny + dpsyco-lib/lenny
		if	[ "$md5" = "5b577c9cb18e4852fc7e45830d230ec1" ] || \
			[ "$md5" = "28928669e36f1ab616dfda39af3d79a7" ]
		then
			rm -fv /etc/adduser.conf
		fi
	fi

	# prevent disappearance of /etc/udev/rules.d/
	if is_installed libticables3; then
		log_debug
		touch /etc/udev/rules.d/.piuparts.dummy
	fi

	# isc-dhcp-server.postinst unconditionally overwrites conffile /etc/dhcp/dhcpd.conf
	if is_installed dhcp3-server; then
		log_debug
		rm -fv /etc/dhcp3/dhcpd.conf
	fi

fi

if [ "$PIUPARTS_DISTRIBUTION_NEXT" = "wheezy" ]; then

	case ${PIUPARTS_OBJECTS%%=*} in
		cnews)
			# dpkg 1.16 does not like the bad cnews version number cr.g7-40.4
			# cnews was removed after lenny
			log_debug
			dpkg --purge cnews
			;;
		lcl-utils|\
		lcl)
			# WORKSAROUND #696075: lcl-utils: directory vs. symlink mess after squeeze => wheezy upgrade: /etc/lazarus
			# the renaming was performed in the postinst of lcl-utils-0.9.30.4,
			# which was not the owner of the old /etc/lazarus,
		        # therefore dpkg does never forget about the old conffiles
			log_debug
			if [ -d /etc/lazarus ] && [ ! -L /etc/lazarus ]; then
				mv -v /etc/lazarus /etc/lazarus.bak
			fi
			;;
		nfsbooted)
			# sysv-rc fails migration to dependency based boot sequence if nfsbooted is installed
			# nfsbooted was removed after lenny
			log_debug
			dpkg --purge nfsbooted
			;;
		pdns-backend-mysql)
			# WORKSAROUND #698562: upgrade from squeeze => wheezy fails if database has not been created before the upgrade
			log_debug
			dpkg --purge pdns-backend-mysql
			;;
		pdns-backend-pgsql)
			# WORKSAROUND #698562: upgrade from squeeze => wheezy fails if database has not been created before the upgrade
			log_debug
			dpkg --purge pdns-backend-pgsql
			;;
	esac

	# E: Could not perform immediate configuration on ...
	#645713, #677805, #706641
	case ${PIUPARTS_OBJECTS%%=*} in
		bug-buddy|\
		gnome|\
		gnome-accessibility|\
		gnome-core|\
		gnome-dbg|\
		gnome-desktop-environment|\
		libgd-text-perl|\
		open-cobol|\
		python-sugar-toolkit-0.86|\
		speechd-el|\
		sucrose-0.86|\
		sugar-browse-activity-0.86|\
		sugar-chat-activity-0.86|\
		sugar-read-activity-0.86)
			log_debug
			echo "Disabling APT::Immediate-Configure"
			echo 'APT::Immediate-Configure "No";' >> /etc/apt/apt.conf.d/piuparts-disable-immediate-configure
			;;
	esac

	# WORKSAROUND #655969: lirc: prompting due to modified conffiles which where not modified by the user: /etc/lirc/hardware.conf
	if [ -f /etc/lirc/hardware.conf ]; then
		log_debug
		sed -i '/^DRIVER=/s/.*/DRIVER="UNCONFIGURED"/' /etc/lirc/hardware.conf
	fi

fi

if [ "$PIUPARTS_DISTRIBUTION_NEXT" = "jessie" ]; then

	case ${PIUPARTS_OBJECTS%%=*} in
		*cyrus*)
			# something was not working properly during the upgrade from 2.2 to 2.4
			if is_installed cyrus-common && [ ! -d /var/lib/cyrus/db ]; then
				echo "FIXING missing /var/lib/cyrus/db"
				cyrus-makedirs --cleansquat
			fi
			;;
		debian-edu-archive-keyring|\
		debian-ports-archive-keyring|\
		emdebian-archive-keyring|\
		emdebian-grip-server)
			# https://bugs.debian.org/687611
			log_debug
			for keyring in /etc/apt/trusted.gpg.d/*.gpg~
			do
				if [ -f "${keyring}" ]; then
					mv -v "${keyring}" "${keyring%~}"
				fi
			done
			;;
		ekeyd-uds)
			# ekeyd-uds was removed after squeeze, maintainer scripts are incompatible with udev/jessie
			log_debug
			dpkg --purge ekeyd-uds
			;;
		otrs2)
			#707075: cannot automatically upgrade from wheezy to jessie due to mysql storage engine change
			if is_installed mysql-server; then
				log_debug
				dbconfig_enable_purge otrs2
				dpkg --purge otrs2
			fi
			;;
	esac

	#825650: libreoffice-common: prompting due to modified conffiles which were not modified by the user: /etc/libreoffice/sofficerc
	# migration did not work properly while upgrading from squeeze to wheezy,
	# gets messed up further while upgrading from wheezy to jessie,
	# eventually leading to problems while upgrading from jessie to stretch
	if is_installed openoffice.org-common; then
		if [ -f /etc/openoffice/sofficerc ] && [ -f /etc/libreoffice/sofficerc ]; then
			log_debug
			for file in sofficerc soffice.sh psprint.conf
			do
				if [ -f /etc/openoffice/$file ] && [ -f /etc/libreoffice/$file ]; then
					rm -v /etc/openoffice/$file
				fi
			done
		fi
	fi

fi

if [ "$PIUPARTS_DISTRIBUTION" = "stretch" ]; then

	case ${PIUPARTS_OBJECTS%%=*} in
		design-desktop*)
			#850948: needrestart/stretch may hang during upgrade
			log_debug
			dpkg-divert --rename /usr/lib/needrestart/apt-pinvoke
			;;
	esac

fi