Commit 1c2fb25e authored by Vitaly Lipatov's avatar Vitaly Lipatov

realize autoorphans/autoremove for zypper >= 1.9.2 in SUSE

parent 3285b495
......@@ -81,9 +81,15 @@ case $PMTYPE in
#pkgng)
# sudocmd pkg autoremove
# ;;
#zypper-rpm)
# sudocmd zypper clean
# ;;
zypper-rpm)
# https://www.linux.org.ru/forum/desktop/11931830
assure_exists zypper zypper 1.9.2
# For zypper < 1.9.2: zypper se -si | grep 'System Packages'
sudocmd zypper packages --orphaned
# FIXME: x86_64/i586 are duplicated
local PKGLIST=$(zypper packages --orphaned | tail -n +5 | cut -d \| -f 3 | sort -u)
sudocmd zypper remove --clean-deps $PKGLIST
;;
*)
fatal "Have no suitable command for $PMTYPE"
;;
......
......@@ -120,9 +120,14 @@ case $PMTYPE in
pkgng)
sudocmd pkg autoremove
;;
#zypper-rpm)
# sudocmd zypper clean
# ;;
zypper-rpm)
# https://www.linux.org.ru/forum/desktop/11931830
assure_exists zypper zypper 1.9.3
sudocmd zypper packages --unneeded
# FIXME: x86_64/i586 are duplicated
local PKGLIST=$(zypper packages --unneeded | tail -n +5 | cut -d \| -f 3 | sort -u)
sudocmd zypper remove --clean-deps $PKGLIST
;;
*)
fatal "Have no suitable command for $PMTYPE"
;;
......
......@@ -93,7 +93,7 @@ epm_remove_names()
sudocmd snappy uninstall $@
return ;;
zypper-rpm)
sudocmd zypper remove $@
sudocmd zypper remove --clean-deps $@
return ;;
mpkg)
sudocmd mpkg remove $@
......@@ -160,7 +160,7 @@ epm_remove_nonint()
sudocmd yum -y remove $@
return ;;
zypper-rpm)
sudocmd zypper --non-interactive remove $@
sudocmd zypper --non-interactive remove --clean-deps $@
return ;;
slackpkg)
sudocmd /usr/sbin/slackpkg -batch=on -default_answer=yes remove $@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment