Commit 0b13cf4a authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-install: add show-command-only support

parent 7475731d
......@@ -64,6 +64,7 @@ quiet=
nodeps=
non_interactive=
skip_installed=
show_command_only=
epm_cmd=
pkg_files=
pkg_names=
......@@ -182,6 +183,9 @@ for opt in "$@" ; do
--skip-installed) # HELPOPT: skip already install during install
skip_installed=1
;;
--show-command-only) # HELPOPT: show command only, do not any action
show_command_only=1
;;
--quiet) # HELPOPT: quiet mode (do not print commands before exec)
quiet=1
;;
......
......@@ -151,9 +151,38 @@ epm_install_files()
epm_install_names $@
}
epm_print_install_command()
{
case $PMTYPE in
apt-rpm|yum-rpm|urpm-rpm|zypper-rpm)
echo "rpm -Uvh --force $nodeps $@"
;;
apt-dpkg)
echo "dpkg -i $@"
;;
pkg_add)
echo "pkg_add $@"
;;
pacman)
echo "pacman -U --noconfirm $@"
;;
slackpkg)
echo "installpkg $@"
;;
*)
fatal "Do not known appropriate install command for $PMTYPE"
;;
esac
}
epm_install()
{
if [ -n "$show_command_only" ] ; then
epm_print_install_command $names
return
fi
[ -n "$pkg_files$pkg_names" ] || fatal "Run install without packages"
local names="$(echo $pkg_names | filter_out_installed_packages)"
......
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