Commit 5c3f57ed authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-remove: fix remove skipping on failed deps

parent cbac2d11
...@@ -23,9 +23,11 @@ load_helper epm-print ...@@ -23,9 +23,11 @@ load_helper epm-print
load_helper epm-sh-warmup load_helper epm-sh-warmup
load_helper epm-sh-install load_helper epm-sh-install
RPMISNOTINSTALLED=202
__check_rpm_e_result() __check_rpm_e_result()
{ {
grep -q "is not installed" $1 && return 2 grep -q "is not installed" $1 && return $RPMISNOTINSTALLED
return $2 return $2
} }
...@@ -42,6 +44,7 @@ epm_remove_low() ...@@ -42,6 +44,7 @@ epm_remove_low()
cd /tmp || fatal cd /tmp || fatal
__epm_check_vendor $@ __epm_check_vendor $@
store_output sudocmd rpm -ev $noscripts $nodeps $@ store_output sudocmd rpm -ev $noscripts $nodeps $@
# rpm returns number of packages if failed on removing
__check_rpm_e_result $RC_STDOUT $? __check_rpm_e_result $RC_STDOUT $?
RES=$? RES=$?
clean_store_output clean_store_output
...@@ -322,7 +325,7 @@ epm_remove() ...@@ -322,7 +325,7 @@ epm_remove()
epm_remove_low $pkg_names && return epm_remove_low $pkg_names && return
local STATUS=$? local STATUS=$?
if [ -n "$direct" ] || [ -n "$nodeps" ] || [ "$STATUS" = "2" ]; then if [ -n "$direct" ] || [ -n "$nodeps" ] || [ "$STATUS" = "$RPMISNOTINSTALLED" ]; then
return $STATUS return $STATUS
fi fi
......
...@@ -8,6 +8,11 @@ run_command() ...@@ -8,6 +8,11 @@ run_command()
$1 2>&1 | tee $RC_STDOUT $1 2>&1 | tee $RC_STDOUT
} }
return_big()
{
return 2021
}
func() func()
{ {
echo STDERR >&2 echo STDERR >&2
...@@ -18,3 +23,6 @@ run_command func ...@@ -18,3 +23,6 @@ run_command func
cat $RC_STDOUT cat $RC_STDOUT
#cat $RC_STDERR #cat $RC_STDERR
rm -f $RC_STDOUT $RC_STDERR rm -f $RC_STDOUT $RC_STDERR
return_big
echo $?
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