File: post_setup_zz_backports

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 (25 lines) | stat: -rwxr-xr-x 632 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
set -e

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
}

PKGS=""

if [ "$PIUPARTS_DISTRIBUTION" = "jessie-backports" ]; then
	# downgrading them from jessie-backports to jessie during removal
	# is problematic due to triggers
	! is_installed systemd || PKGS="${PKGS} systemd"
	! is_installed udev || PKGS="${PKGS} udev"
fi

if [ -n "$PKGS" ]; then
	apt-get -y -t "$PIUPARTS_DISTRIBUTION" install $PKGS
fi