remove-old-kernels: Do not try to output removal list if it's empty
Fixes: 573337d ("remove-old-kernels: Change confirmation logic") Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
parent
a3fff046ef
commit
185d99fade
@ -175,16 +175,16 @@ printf "%s" "$keep_kernels"
|
|||||||
[ -n "$other_flavours" ] && echo "Specify -A to remove all kernels of other flavours than $kernel_flavour."
|
[ -n "$other_flavours" ] && echo "Specify -A to remove all kernels of other flavours than $kernel_flavour."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
howmuch=$(echo "$remove_kernels" | grep -c .)
|
|
||||||
[ "$howmuch" -eq 1 ] && phrase="this kernel" || phrase="these $BRIGHT$howmuch$NORM kernels"
|
|
||||||
echo "Removing $phrase:"
|
|
||||||
echo "$remove_kernels"
|
|
||||||
|
|
||||||
if [ -z "$apt_args_list" ] ; then
|
if [ -z "$apt_args_list" ] ; then
|
||||||
echo "Nothing to remove."
|
echo "Nothing to remove."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
howmuch=$(echo "$remove_kernels" | grep -c .)
|
||||||
|
[ "$howmuch" -eq 1 ] && phrase="this kernel" || phrase="these $BRIGHT$howmuch$NORM kernels"
|
||||||
|
echo "Removing $phrase:"
|
||||||
|
echo "$remove_kernels"
|
||||||
|
|
||||||
if [ "$UID" != "0" ]; then
|
if [ "$UID" != "0" ]; then
|
||||||
echo >&2 "${RED}Warning: This program requires root privileges.$NORM"
|
echo >&2 "${RED}Warning: This program requires root privileges.$NORM"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user