-
-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathpreinst
More file actions
executable file
·42 lines (36 loc) · 1.67 KB
/
preinst
File metadata and controls
executable file
·42 lines (36 loc) · 1.67 KB
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
36
37
38
39
40
41
42
#!/bin/sh
# Filename: preinst
# Purpose: preinst script for package grml-etc-core
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
################################################################################
set -e
case "$1" in
install|upgrade|configure)
TMP=$$
for file in /etc/zsh/zlogin /etc/zsh/zprofile /etc/zsh/zshenv /etc/zsh/zshrc \
/etc/vim/vimrc /etc/tmux.conf; do
# make sure we don't lose anything
# yes this is ugly :(
[ -e "$file".original ] || cp -f "$file" "${file}.tmp.$TMP" 2>/dev/null || true
[ -e "$file" ] && cp -f "$file" "$file".grml-etc-core && \
[ -f "$file" ] && rm "$file" && \
dpkg-divert --quiet --add --rename --package grml-etc-core --divert "$file".original $file && \
[ -f "$file".grml-etc-core ] && mv -f "$file".grml-etc-core "$file"
[ -e "${file}.tmp.$TMP" ] && mv -f "${file}.tmp.$TMP" "$file.original"
done
# we stopped shipping /etc/zsh/zlogout with v0.20.0,
# make sure we don't leave it behind on updated systems
if dpkg-divert --list grml-etc-core 2>/dev/null | grep -q '/etc/zsh/zlogout' ; then
mv -f /etc/zsh/zlogout /etc/zsh/zlogout.old && \
dpkg-divert --remove --rename --package grml-etc-core /etc/zsh/zlogout
fi
;;
*)
echo "preinst called with unknown argument $1" >&2
exit 1
esac
#DEBHELPER#
exit 0
## END OF FILE #################################################################