File: post_setup_force-unsafe-io

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

case ${PIUPARTS_OBJECTS%%=*} in
	TARBALL)
		# skip while creating the tarball
		exit 0
		;;
esac

if [ ! -f /etc/dpkg/dpkg.cfg.d/piuparts-force-unsafe-io ]
then
	if dpkg --force-help | grep -q unsafe-io
	then
		echo "Enabling dpkg --force-unsafe-io."
		echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/piuparts-force-unsafe-io
	fi
fi

if [ ! -h /bin/sync ]
then
	if test -e /usr/bin/sync; then
		if dpkg -S /usr/bin/sync >/dev/null 2>&1; then
			mv /usr/bin/sync /usr/bin/sync.distrib
		else
			mv /bin/sync /bin/sync.distrib.usr-is-merged
		fi
		dpkg-divert --add --no-rename --divert /usr/bin/sync.distrib /usr/bin/sync
		dpkg-divert --add --no-rename --divert /bin/sync.distrib.usr-is-merged /bin/sync
	else
		# We're probably unmerged-/usr and a single diversion will do.
		dpkg-divert --add --rename --divert /bin/sync.distrib /bin/sync
	fi
	ln -sv true /bin/sync
fi