Codebase list kali-menu / 27cd065
Avoid conffile prompt for xfce-applications.menu during initial install The logic used during upgrade must also be used during initial installation. Raphaƫl Hertzog 4 years ago
1 changed file(s) with 13 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
22 set -e
33
44 setup_diversion() {
5 # $1: is file to divert
6 dpkg-divert --rename --package kali-menu \
7 --divert $1.original \
8 --add $1
5 local file="$1"
6 divert_opts="--rename"
7 if [ -e "$file" ]; then
8 if dpkg --search "$file" >/dev/null 2>&1; then
9 # Keep original file to avoid spurious dpkg prompt
10 cp "$file" "$file.original"
11 divert_opts="--no-rename"
12 fi
13 fi
14 dpkg-divert $divert_opts --package kali-menu \
15 --divert "$file.original" \
16 --add "$file"
917 }
1018
1119 case "$1" in
1523
1624 upgrade)
1725 if dpkg --compare-versions "$2" lt 2020.1.0; then
18 # Don't rename it to avoid a conffile prompt
19 dpkg-divert --no-rename --package kali-menu \
20 --divert /etc/xdg/menus/xfce-applications.menu.original \
21 --add /etc/xdg/menus/xfce-applications.menu
22 if [ -e /etc/xdg/menus/xfce-applications.menu ]; then
23 cp /etc/xdg/menus/xfce-applications.menu \
24 /etc/xdg/menus/xfce-applications.menu.original
25 fi
26 setup_diversion /etc/xdg/menus/xfce-applications.menu
2627 fi
2728 ;;
2829 esac