Commit ba3b1451 authored by Vitaly Lipatov's avatar Vitaly Lipatov

implement assure_distr and use it

parent 6d4e4977
...@@ -680,6 +680,7 @@ epm_print_install_names_command() ...@@ -680,6 +680,7 @@ epm_print_install_names_command()
epm_install() epm_install()
{ {
if tasknumber "$pkg_names" >/dev/null ; then if tasknumber "$pkg_names" >/dev/null ; then
assure_distr ALTLinux "install with task number"
assure_exists apt-repo assure_exists apt-repo
sudocmd apt-repo test $(tasknumber "$pkg_names") sudocmd apt-repo test $(tasknumber "$pkg_names")
return return
......
...@@ -244,6 +244,7 @@ epm_remove() ...@@ -244,6 +244,7 @@ epm_remove()
local tn=$(tasknumber "$pkg_names") local tn=$(tasknumber "$pkg_names")
if [ -n "$tn" ] ; then if [ -n "$tn" ] ; then
assure_distr ALTLinux "remove with task number"
assure_exists apt-repo assure_exists apt-repo
pkg_names=$(showcmd apt-repo list $tn) pkg_names=$(showcmd apt-repo list $tn)
#docmd epm remove $dryrun #docmd epm remove $dryrun
......
...@@ -549,3 +549,10 @@ is_active_systemd() ...@@ -549,3 +549,10 @@ is_active_systemd()
# shellcheck disable=SC2009 # shellcheck disable=SC2009
ps ax | grep '[s]ystemd' | grep -q -v 'systemd-udev' ps ax | grep '[s]ystemd' | grep -q -v 'systemd-udev'
} }
assure_distr()
{
local TEXT="this option"
[ -n "$2" ] && TEXT="$2"
[ "$DISTRNAME" = "$1" ] || fatal "$TEXT supported only for $1 distro"
}
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