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

fix timeout using on FreeBSD

parent 480d5a38
...@@ -324,7 +324,7 @@ done ...@@ -324,7 +324,7 @@ done
# if input is not console, get pkg from it too # if input is not console, get pkg from it too
if ! inputisatty ; then if ! inputisatty ; then
for opt in $(timeout 1 cat 2>/dev/null) ; do for opt in $(withtimeout 1 cat) ; do
check_filenames $opt check_filenames $opt
done done
fi fi
......
...@@ -261,6 +261,12 @@ set_sudo() ...@@ -261,6 +261,12 @@ set_sudo()
SUDO="fatal 'Can't find sudo. Please install sudo or run epm under root.'" SUDO="fatal 'Can't find sudo. Please install sudo or run epm under root.'"
} }
withtimeout()
{
local TO=$(which timeout 2>/dev/null || which gtimeout 2>/dev/null)
[ -n "$TO" ] && $TO $@ || $@
}
set_eatmydata() set_eatmydata()
{ {
# skip if disabled # skip if disabled
......
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