File: post_install_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 (46 lines) | stat: -rwxr-xr-x 1,211 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
41
42
43
44
45
46
#!/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
}

case ${PIUPARTS_OBJECTS%%=*} in
	apt-listbugs)		log_debug
				# when installed apt-listbugs is run on installations / upgrades
				# and will cause them to fail due to prompting
				# if packages being installed currently have RC bugs.
				# so disable it here.
				dpkg-divert --rename /usr/sbin/apt-listbugs

				ln -svf /bin/true /usr/sbin/apt-listbugs
				;;
esac

if is_installed dkms; then
	# remember for post_purge_exceptions
	touch /var/run/piuparts-stamp-dkms-installed
	# if dkms built a kernel module, there might be a
	# leftover 'sleep' process from progress reporting
	sleep 3
fi

for pgconf in /etc/postgresql/*/main/postgresql.conf
do
	test -f "$pgconf" && test -r "$pgconf" || continue
	port=$(awk '/^port/ { print $3 }' "$pgconf")
	if [ "-n" $port ] && [ "$port" != "5432" ]
	then
		echo "Non-default port in $pgconf"
	fi
done