Commit c517c791 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-autoremove: rewrite help, add python2 and python3 separately

parent 4d1013cf
......@@ -128,6 +128,8 @@ __epm_autoremove_altrpm_lib()
}
epm_autoremove_default_groups="python2 python3 perl libs"
__epm_autoremove_altrpm()
{
local i
......@@ -135,9 +137,7 @@ __epm_autoremove_altrpm()
assure_exists /usr/share/apt/scripts/list-nodeps.lua apt-scripts
if [ -z "$pkg_names" ] ; then
__epm_autoremove_altrpm_pp '^(python-module-|python3-module-|python-modules-|python3-modules|perl-)'
__epm_autoremove_altrpm_lib nodevel
return 0
pkg_names="$epm_autoremove_default_groups"
fi
for i in $pkg_names ; do
......@@ -161,7 +161,7 @@ __epm_autoremove_altrpm()
__epm_autoremove_altrpm_lib
;;
*)
fatal "autoremove: unsupported '$i'. Use libs, python, python2, python3, perl, libs-devel."
fatal "autoremove: unsupported '$i'. Use epm autoremove --help to list supported ones"
;;
esac
done
......@@ -169,19 +169,41 @@ __epm_autoremove_altrpm()
return 0
}
epm_autoremove_print_help()
{
echo "epm autoremove removes unneeded packages from the system"
echo "run 'epm autoremove' to use apt-get autoremove"
echo "or run 'epm autoremove --direct [group1] [group2] ...' to use epm implementation"
echo "Default groups: $epm_autoremove_default_groups"
cat <<EOF
Supported package groups:
libs - unused libraries
libs-devel - unused -devel packages
python - all python modules
python2 - python2 modules
python3 - python3 modules
perl - perl- modules
EOF
}
# TODO: keep our eepm package
epm_autoremove()
{
case $DISTRNAME in
ALTLinux)
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ] ; then
epm_autoremove_print_help
return 0
fi
if [ -z "$direct" ] ; then
sudocmd apt-get $(subst_option non_interactive -y) autoremove $dryrun
local RET=$?
info "Also you can run 'epm autoremove --direct' to use low level autoremove (epm internal implementation)"
info "Also you can run 'epm autoremove --direct' to use epm implementation of autoremove (see --help)"
[ "$RET" = 0 ] || return
else
__epm_autoremove_altrpm
__epm_autoremove_altrpm "$@"
fi
[ -n "$dryrun" ] && return
......
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