Commit 05803c0f authored by Vitaly Lipatov's avatar Vitaly Lipatov

rewrite eterbuild dir detection

parent 42df349f
...@@ -5,20 +5,22 @@ ...@@ -5,20 +5,22 @@
set_eterbuilddir() set_eterbuilddir()
{ {
# if run from no system installation [ -z "$ETERBUILDDIR" ] || return 0
if dirname $0 | grep $ETERBUILDDIR >/dev/null ; then
if dirname $0 | grep /usr >/dev/null ; then
ETERBUILDETC=/etc/eterbuild ETERBUILDETC=/etc/eterbuild
ETERBUILDDIR=/usr/share/eterbuild ETERBUILDDIR=/usr/share/eterbuild
else else
# if run from no system installation
ETERBUILDDIR=$(realpath `dirname $0`/../share/eterbuild) ETERBUILDDIR=$(realpath `dirname $0`/../share/eterbuild)
ETERBUILDETC=$(realpath `dirname $0`/../etc) ETERBUILDETC=$(realpath `dirname $0`/../etc)
echo "Note: run from source tree, datadir=$ETERBUILDDIR, sysconfdir=$ETERBUILDETC" echo "Note: run from source tree, datadir=$ETERBUILDDIR, sysconfdir=$ETERBUILDETC"
fi fi
[ -n "$ETERBUILDDIR" ]
} }
# set if empty and check it # set if empty and check it
[ -n "$ETERBUILDDIR" ] || set_eterbuilddir if ! set_eterbuilddir ; then
if [ -z "$ETERBUILDIR" ] ; then
echo "Can't detect package files location" echo "Can't detect package files location"
exit 1 exit 1
fi fi
......
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