File: cryptsetup.preinst

package info (click to toggle)
cryptsetup 2%3A2.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 19,624 kB
  • sloc: ansic: 62,955; sh: 16,774; cpp: 994; xml: 920; makefile: 488; perl: 486
file content (27 lines) | stat: -rw-r--r-- 910 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

set -e

if [ "$1" = install ] && [ ! -f "/etc/crypttab" ]; then
	cat <<-EOC >/etc/crypttab
	# <target name>	<source device>		<key file>	<options>
	EOC
fi

# begin-remove-after: released:forky
if [ "$1" = "upgrade" ] || [ "$1" = install ]; then
	if [ "$(dpkg-divert --truename /lib/cryptsetup/askpass)" = /lib/cryptsetup/askpass.cryptsetup ] &&
		[ "$(dpkg-divert --listpackage /lib/cryptsetup/askpass)" = cryptsetup-nuke-password ] &&
		[ "$(dpkg-divert --truename /usr/lib/cryptsetup/askpass)" = /usr/lib/cryptsetup/askpass ]; then
		# A pre-/usr-merge cryptsetup-nuke-password is installed.
		echo "Mitigating diversion of /lib/cryptsetup/askpass on behalf of cryptsetup-nuke-password"
		dpkg-divert --no-rename --package cryptsetup-nuke-password \
			    --divert /usr/lib/cryptsetup/askpass.usr-is-merged \
			    --add /usr/lib/cryptsetup/askpass
	fi
fi
# end-remove-after

#DEBHELPER#

exit 0