["$nofail"="nofail"]||SUDO="fatal 'Can't use sudo (only without password sudo is supported in non interactive using). Please run epm under root.'"
["$nofail"="nofail"]||SUDO="fatal 'Can't use sudo (only passwordless sudo is supported in non interactive using). Please run epm under root.'"
return"$SUDO_TESTED"
return"$SUDO_TESTED"
fi
fi
else
else
# use sudo if one is tuned and tuned without password
# use sudo if one is tuned and tuned without password
if!$SUDO_CMD-l-n>/dev/null 2>/dev/null ;then
if!$SUDO_CMD-l-n>/dev/null 2>/dev/null ;then
["$nofail"="nofail"]||SUDO="fatal 'Can't use sudo (only without password sudo is supported). Please run epm under root or check http://altlinux.org/sudo.'"
["$nofail"="nofail"]||SUDO="fatal 'Can't use sudo (only passwordless sudo is supported). Please run epm under root or check http://altlinux.org/sudo.'"
return"$SUDO_TESTED"
return"$SUDO_TESTED"
fi
fi
fi
fi
...
@@ -378,6 +378,12 @@ set_sudo()
...
@@ -378,6 +378,12 @@ set_sudo()
}
}
# return TRUE if we can run privileged command
sudo_allowed()
{
set_sudo nofail
}
# wait for n seconds (if possible) during executing command
# wait for n seconds (if possible) during executing command