Commit afe8fa0f authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-simulate: print result of the check

parent 4e48fd82
...@@ -21,15 +21,10 @@ ...@@ -21,15 +21,10 @@
load_helper epm-install load_helper epm-install
load_helper epm-search load_helper epm-search
epm_simulate() _epm_do_simulate()
{ {
local CMD local CMD
[ -z "$pkg_filenames" ] && echo "Skip empty list" && return 2 local filenames=$@
local filenames="$(echo $pkg_filenames | filter_out_installed_packages)"
[ -z "$filenames" ] && echo "All packages are already installed" && return 2
case $PMTYPE in case $PMTYPE in
apt-rpm|apt-dpkg) apt-rpm|apt-dpkg)
CMD="apt-get --simulate install" CMD="apt-get --simulate install"
...@@ -70,3 +65,19 @@ epm_simulate() ...@@ -70,3 +65,19 @@ epm_simulate()
sudocmd $CMD $filenames sudocmd $CMD $filenames
} }
epm_simulate()
{
[ -z "$pkg_filenames" ] && echo "Skip empty list" && return 2
local filenames="$(echo $pkg_filenames | filter_out_installed_packages)"
[ -z "$filenames" ] && echo "All packages are already installed" && return 2
_epm_do_simulate $filenames
local RES=$?
if [ -z "$quiet" ] ; then
[ "$RES" = 0 ] && echo "Result: $filenames package(s) CAN BE installed" || echo "Result: There are PROBLEMS with install some package(s)"
fi
return $RES
}
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