Codebase list kali-defaults / 299d584
Call unconfigure_environment a bit earlier during postrm Same comment as in previous commit: this does not really matter, as kali-defaults is not supposed to be removed anyway. This change is mainly to ease side by side comparison with the postinst script: we add a function (as it is in postinst), and we make sure to do things in reverse order, compared to what was done in postinst. Arnaud Rebillout 3 years ago
1 changed file(s) with 10 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
3535 --remove $file
3636 }
3737
38 unconfigure_environment() {
39 # Cleanup change to /etc/environment
40 if grep -q ^PATH= /etc/environment; then
41 echo "Dropping PATH override from /etc/environment"
42 sed -i -e '/^PATH=/d' /etc/environment
43 fi
44 }
45
3846 case "$1" in
3947 remove)
4048 echo "Unconfiguring root account"
4553 rm -v /root/.zshrc
4654 fi
4755
56 unconfigure_environment
57
4858 for file in $FILES_TO_DIVERT; do
4959 rm -f $file
5060 drop_diversion $file $file.original
5161 done
52 # Cleanup change to /etc/environment
53 if grep -q ^PATH= /etc/environment; then
54 echo "Drop PATH override from /etc/environment"
55 sed -i -e '/^PATH=/d' /etc/environment
56 fi
5762 ;;
5863
5964 purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)