r3559@krups: intrigeri | 2005-11-15 15:07:17 +0100
authorintrigeri <intrigeri@758a04ac-41e6-0310-8a23-8373a73cc35d>
Tue, 29 Nov 2005 10:09:31 +0000 (10:09 +0000)
committerintrigeri <intrigeri@758a04ac-41e6-0310-8a23-8373a73cc35d>
Tue, 29 Nov 2005 10:09:31 +0000 (10:09 +0000)
 ninjahelper & backupninja now set $libdir when bootstrapping. improved $scriptdir search, too.

git-svn-id: http://code.autistici.org/svn/backupninja/trunk@243 758a04ac-41e6-0310-8a23-8373a73cc35d

src/Makefile.am
src/Makefile.in
src/backupninja.in
src/ninjahelper.in

index d0c77fcf1e1bb1436b2419934663a040f1e8a0fe..44b314845c885980fd215c1c2fa43d124edd8ec3 100644 (file)
@@ -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'
 
index 912026e8af061d70119869fdf9da72917adae839..1eb113270f3a080e76f623852984bce779c1eb29 100644 (file)
@@ -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'
 
index 31b8d1b10545c3147bafbf74f66f8de545fd0b3f..8f7bd03f39542a1e537cb4e13fcb4850978e5a22 100755 (executable)
@@ -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
index f0ad45a9685cc6d28fbafe883fefcaf35cee2638..099a5808b9086ea426f3dcf35a65094d833c778d 100755 (executable)
@@ -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"