Commit 02262940 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: allow direct run the scripts

parent deb36b44
The main purpose of any play.d script is download and install package.
The main purpose of any play.d script is to download and to install a package.
Allowed variables:
* $DISTRVENDOR (distro_info utility)
* $SUDO
* $DISTRVENDOR (distro_info utility) (legacy, use epm print info instead of)
* $SUDO (will filled with 'sudo' command when running without root privilegies
Allowed commands:
* epm (run the same epm called from)
......
......@@ -96,7 +96,7 @@ case "$1" in
# just pass
;;
*)
fatal "Unknown command $1"
fatal "Unknown command '$1'. Use this script only via epm play."
;;
esac
......@@ -112,5 +112,16 @@ check_supported_arch()
return 1
}
# legacy compatibility and support direct run the script
if [ -z "$DISTRVENDOR" ] ; then
export DISTRVENDOR="epm print info"
if [ -x "../bin/epm" ] ; then
export PATH="$(realpath ../bin):$PATH"
fi
fi
if [ -z "$SUDO" ] && [ "$UID" != "0" ] ; then
SUDO="sudo"
fi
check_supported_arch $SUPPORTEDARCHES || fatal "Only $SUPPORTEDARCHES is supported"
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