Commit 2284bce2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-install: fix Slackware install with sudocmd_foreach

parent 658c5f05
......@@ -100,9 +100,8 @@ epm_install_names()
return ;;
slackpkg)
separate_installed $@
# TODO: use upgrade if package is already installed
[ -n "$pkg_noninstalled" ] && sudocmd /usr/sbin/slackpkg install $pkg_noninstalled
[ -n "$pkg_installed" ] && sudocmd /usr/sbin/slackpkg upgrade $pkg_installed
[ -n "$pkg_noninstalled" ] && sudocmd_foreach "/usr/sbin/slackpkg install" $pkg_noninstalled
[ -n "$pkg_installed" ] && sudocmd_foreach "/usr/sbin/slackpkg upgrade" $pkg_installed
return ;;
homebrew)
separate_installed $@
......@@ -169,9 +168,9 @@ epm_ni_install_names()
return ;;
slackpkg)
separate_installed $@
# FIXME: broken status when use batch and default answrt
[ -n "$pkg_noninstalled" ] && sudocmd /usr/sbin/slackpkg -batch=on -default_answer=yes install $pkg_noninstalled
[ -n "$pkg_installed" ] && sudocmd /usr/sbin/slackpkg -batch=on -default_answer=yes upgrade $pkg_installed
# FIXME: broken status when use batch and default answer
[ -n "$pkg_noninstalled" ] && sudocmd_foreach "/usr/sbin/slackpkg -batch=on -default_answer=yes install" $pkg_noninstalled
[ -n "$pkg_installed" ] && sudocmd_foreach "/usr/sbin/slackpkg -batch=on -default_answer=yes upgrade" $pkg_installed
return ;;
*)
fatal "Have no suitable appropriate install command for $PMTYPE"
......
......@@ -96,7 +96,7 @@ docmd()
"$@"
}
# Print command line and run command line
# Run every arg with docmd
docmd_foreach()
{
local cmd
......@@ -115,6 +115,19 @@ sudocmd()
$SUDO "$@"
}
# Run every arg with sudocmd
sudocmd_foreach()
{
local cmd
cmd="$1"
#showcmd "$@"
shift
for pkg in "$@" ; do
sudocmd $cmd $pkg
done
}
filter_strip_spaces()
{
# possible use just
......
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