aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2005-11-29 10:09:31 +0000
committerintrigeri <intrigeri@boum.org>2005-11-29 10:09:31 +0000
commit5d63983704cf68acc3f6d0fe9b2e9c836078ec2c (patch)
tree19f2fb2054e9d9a6c1b3c12492f2f9c3909b43d2 /src
parentbac37f747b7760679e29eb8b3d8dca249419408e (diff)
downloadbackupninja-5d63983704cf68acc3f6d0fe9b2e9c836078ec2c.tar.gz
backupninja-5d63983704cf68acc3f6d0fe9b2e9c836078ec2c.tar.bz2
r3559@krups: intrigeri | 2005-11-15 15:07:17 +0100
ninjahelper & backupninja now set $libdir when bootstrapping. improved $scriptdir search, too.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/Makefile.in1
-rwxr-xr-xsrc/backupninja.in33
-rwxr-xr-xsrc/ninjahelper.in41
4 files changed, 56 insertions, 20 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index d0c77fc..44b3148 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -10,6 +10,7 @@ edit = sed \
-e "s,@CFGDIR\@,$(CFGDIR),g" \
-e "s,@BASH\@,$(BASH),g" \
-e 's,@datadir\@,$(pkgdatadir),g' \
+ -e "s,@libdir\@,$(pkglibdir),g" \
-e 's,@localstatedir\@,$(localstatedir),g' \
-e 's,@prefix\@,$(prefix),g'
diff --git a/src/Makefile.in b/src/Makefile.in
index 912026e..1eb1132 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -115,6 +115,7 @@ edit = sed \
-e "s,@CFGDIR\@,$(CFGDIR),g" \
-e "s,@BASH\@,$(BASH),g" \
-e 's,@datadir\@,$(pkgdatadir),g' \
+ -e "s,@libdir\@,$(pkglibdir),g" \
-e 's,@localstatedir\@,$(localstatedir),g' \
-e 's,@prefix\@,$(prefix),g'
diff --git a/src/backupninja.in b/src/backupninja.in
index 31b8d1b..8f7bd03 100755
--- a/src/backupninja.in
+++ b/src/backupninja.in
@@ -424,15 +424,36 @@ if [ ! -r "$conffile" ]; then
fatal "Configuration file $conffile not found."
fi
+# find $scriptdir
scriptdir=`grep scriptdirectory $conffile | awk '{print $3}'`
-if [ ! -n "$scriptdir" ]; then
- echo "Cound not find entry 'scriptdirectory' in $conffile"
- fatal "Cound not find entry 'scriptdirectory' in $conffile"
+if [ -z "$scriptdir" ]; then
+ if [ -d "@datadir@" ]; then
+ scriptdir="@datadir@"
+ else
+ echo "Could not find entry 'scriptdirectory' in $conffile"
+ fatal "Could not find entry 'scriptdirectory' in $conffile"
+ fi
+else
+ if [ ! -d "$scriptdir" ]; then
+ echo "Script directory $scriptdir not found."
+ fatal "Script directory $scriptdir not found."
+ fi
fi
-if [ ! -d "$scriptdir" ]; then
- echo "Script directory $scriptdir not found."
- fatal "Script directory $scriptdir not found."
+# find $libdir
+libdir=`grep libdirectory $conffile | awk '{print $3}'`
+if [ -z "$libdir" ]; then
+ if [ -d "@libdir@" ]; then
+ libdir="@libdir@"
+ else
+ echo "Could not find entry 'libdirectory' in $conffile."
+ fatal "Could not find entry 'libdirectory' in $conffile."
+ fi
+else
+ if [ ! -d "$libdir" ]; then
+ echo "Lib directory $libdir not found."
+ fatal "Lib directory $libdir not found."
+ fi
fi
setfile $conffile
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"