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