Commit ff216f8d authored by Vitaly Lipatov's avatar Vitaly Lipatov

add check for sed, which and grep commands

parent c9ec915d
...@@ -19,6 +19,14 @@ ...@@ -19,6 +19,14 @@
# copied from /etc/init.d/outformat (ALT Linux) # copied from /etc/init.d/outformat (ALT Linux)
check_core_commands()
{
which --help >/dev/null || fatal "Can't find which command (which package is missed?)"
grep --help >/dev/null || fatal "Can't find grep command (coreutils package is missed?)"
sed --help >/dev/null || fatal "Can't find sed command (sed package is missed?)"
}
# FIXME on Android: FIX ME! implement ttyname_r() bionic/libc/bionic/stubs.c:366 # FIXME on Android: FIX ME! implement ttyname_r() bionic/libc/bionic/stubs.c:366
inputisatty() inputisatty()
{ {
...@@ -47,6 +55,8 @@ check_tty() ...@@ -47,6 +55,8 @@ check_tty()
[ -n "$TERM" ] || TERM=dumb [ -n "$TERM" ] || TERM=dumb
export TERM export TERM
check_core_commands
# egrep from busybox may not --color # egrep from busybox may not --color
# egrep from MacOS print help to stderr # egrep from MacOS print help to stderr
if grep -E --help 2>&1 | grep -q -- "--color" ; then if grep -E --help 2>&1 | grep -q -- "--color" ; then
...@@ -364,9 +374,10 @@ withtimeout() ...@@ -364,9 +374,10 @@ withtimeout()
$TO "$@" $TO "$@"
return return
fi fi
fatal "Possible indefinite wait due timeout command is missed"
# fallback: drop time arg and run without timeout # fallback: drop time arg and run without timeout
shift #shift
"$@" #"$@"
} }
set_eatmydata() set_eatmydata()
......
...@@ -29,6 +29,8 @@ Provides: epm = %EVR ...@@ -29,6 +29,8 @@ Provides: epm = %EVR
Requires: apt rpm Requires: apt rpm
%endif %endif
Requires: which
%description %description
Etersoft EPM is the package manager for any platform Etersoft EPM is the package manager for any platform
and any platform version. It provides and any platform version. It provides
......
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