File: gzip.preinst

package info (click to toggle)
gzip 1.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,984 kB
  • sloc: ansic: 38,281; sh: 9,012; makefile: 384; perl: 11
file content (22 lines) | stat: -rw-r--r-- 658 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
#!/bin/sh

set -e

# begin-remove-after: released:forky
if [ "$1" = upgrade ] || [ "$1" = install ]; then
	for tool in zcat zcmp zdiff zegrep zfgrep zgrep; do
		if [ "$(dpkg-divert --truename "/bin/$tool")" = "/bin/$tool.gzip" ] &&
			[ "$(dpkg-divert --listpackage "/bin/$tool")" = zutils ] &&
			[ "$(dpkg-divert --truename "/usr/bin/$tool")" = "/usr/bin/$tool" ]; then
			# A pre-/usr-move diversion is installed by zutils.
			echo "Mitigating diversion of /bin/$tool on behalf of zutils"
			dpkg-divert --no-rename --package zutils \
				--divert "/usr/bin/$tool.usr-is-merged" \
				--add "/usr/bin/$tool"
		fi
	done
fi
# end-remove-after


#DEBHELPER#