aboutsummaryrefslogtreecommitdiff
path: root/src/ninjahelper.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninjahelper.in')
-rwxr-xr-xsrc/ninjahelper.in41
1 files changed, 27 insertions, 14 deletions
diff --git a/src/ninjahelper.in b/src/ninjahelper.in
index f0ad45a..099a580 100755
--- a/src/ninjahelper.in
+++ b/src/ninjahelper.in
@@ -187,24 +187,37 @@ if [ ! -r "$conffile" ]; then
echo "Configuration file $conffile not found."
exit 1
fi
+# find $scriptdir
scriptdir=`grep scriptdirectory $conffile | awk '{print $3}'`
-if [ ! -n "$scriptdir" ]; then
- echo "Cound not find entry 'scriptdirectory' in $conffile"
- exit 1
-fi
-if [ ! -d "$scriptdir" ]; then
- echo "Script directory $scriptdir not found."
- exit 1
+if [ -z "$scriptdir" ]; then
+ if [ -d "@datadir@" ]; then
+ scriptdir="@datadir@"
+ else
+ echo "Could not find entry 'scriptdirectory' in $conffile"
+ exit 1
+ fi
+else
+ if [ ! -d "$scriptdir" ]; then
+ echo "Script directory $scriptdir not found."
+ exit 1
+ fi
fi
+# find $libdir
libdir=`grep libdirectory $conffile | awk '{print $3}'`
-if [ ! -n "$libdir" ]; then
- echo "Cound not find entry 'libdirectory' in $conffile"
- exit 1
-fi
-if [ ! -d "$libdir" ]; then
- echo "Script directory $libdir not found."
- exit 1
+if [ -z "$libdir" ]; then
+ if [ -d "@libdir@" ]; then
+ libdir="@libdir@"
+ else
+ echo "Could not find entry 'libdirectory' in $conffile."
+ exit 1
+ fi
+else
+ if [ ! -d "$libdir" ]; then
+ echo "Lib directory $libdir not found."
+ exit 1
+ fi
fi
+
configdirectory=`grep configdirectory $conffile | awk '{print $3}'`
if [ ! -n "$configdirectory" ]; then
echo "Cound not find entry 'configdirectory' in $conffile"