File: git.postrm

package info (click to toggle)
git 1%3A2.1.4-2.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 28,832 kB
  • sloc: ansic: 154,058; sh: 131,926; perl: 28,828; tcl: 21,269; python: 5,337; makefile: 3,509; lisp: 1,786; php: 120; asm: 98; csh: 45
file content (35 lines) | stat: -rw-r--r-- 1,080 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
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
set -e

# Snippet based on dpkg-maintscript-helper from dpkg 1.15.8.
# Postinst explains why.
rm_conffile () {
	CONFFILE=$1; shift
	if test "$1" = purge; then
		rm -f "$CONFFILE.dpkg-bak" "$CONFFILE.dpkg-remove" \
			"$CONFFILE.dpkg-backup"
		return
	fi

	test "$1" = abort-install || test "$1" = abort-upgrade || return 0
	dpkg --compare-versions "$2" lt-nl "$3" || return 0
	if test -e "$CONFFILE.dpkg-remove"; then
		echo "Reinstalling $CONFFILE that was moved away"
		mv "$CONFFILE.dpkg-remove" "$CONFFILE"
	fi
	if test -e "$CONFFILE.dpkg-backup"; then
		echo "Reinstalling $CONFFILE that was backed up"
		mv "$CONFFILE.dpkg-backup" "$CONFFILE"
	fi
}

rm_conffile /etc/bash_completion.d/git "$1" "$2" '1:1.8.0-1~'

# Now /etc/emacs/site-start.d/50git-core.el belongs to the
# git-el package.
#
# NOTE: this leaves behind a /etc/emacs/site-start.d/50git-core.el
# file if it was modified while the broken 1.7.4.1-1 package
# was installed.  Installing and purging git-el works around
# that.
rm_conffile /etc/emacs/site-start.d/50git-core.el "$1" "$2" '1:1.7.4.1-2~'