gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 5606978 11/16: Configuration file in tests/dur


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 5606978 11/16: Configuration file in tests/during-dev.sh
Date: Wed, 24 Aug 2016 22:27:44 +0000 (UTC)

branch: master
commit 5606978f412dd41de668e48d20953861c1014800
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Configuration file in tests/during-dev.sh
    
    `tests/during-dev.sh' now copies the configuration file (and makes a
    `.gnuastro' directory to keep it in if necessary). During development the
    configuration file might also be changed and updated and we don't want the
    system-wide or user configuration files mixing up with our development, so
    a `onlydirconf 1' line is also added to the copied configuration file.
---
 tests/during-dev.sh |   22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/tests/during-dev.sh b/tests/during-dev.sh
index 84ba39e..410e3ac 100755
--- a/tests/during-dev.sh
+++ b/tests/during-dev.sh
@@ -102,8 +102,9 @@ if [ x"$builddir" = x ]; then echo "builddir is not set."; 
exit 1; fi
 # absolute. This is done because we will be going into the output directory
 # for executing the utility and we need to know the absolute address of the
 # top build directory.
+srcdir=$(pwd)
 if [ ! "${builddir:0:1}" = "/" ]; then
-   builddir=$(pwd)"/$builddir"
+   builddir="$srcdir/$builddir"
 fi
 
 
@@ -120,12 +121,29 @@ if [ -f "$utility" ]; then rm "$utility"; fi
 # edit/rebuild the libraries too). If Make is successful, then change to
 # the output directory and run the utility with the given arguments and
 # options.
-curdir=$(pwd)
+#
+# Before actually running put a copy of the configuration file in the
+# output directory and also add the onlydirconf option so user or system
+# wide configuration files don't interfere.
 if make -C "$builddir"; then
 
     # Change to the output directory.
     cd "$outdir"
 
+    # Make the .gnuastro directory if it doesn't exist.
+    if [ ! -d .gnuastro ]; then
+       mkdir .gnuastro
+    fi
+
+    # Put a copy of this utility's configuration file there and add the
+    # onlydirconf option. We are first printing an empty line just in case
+    # the last line in the configuration file doesn't actualy end with a
+    # new line (in which case the appended string will be added to the end
+    # of the last line.
+    cp "$srcdir/src/$utilname/ast$utilname.conf" .gnuastro/
+    echo ""               >> .gnuastro/ast$utilname.conf
+    echo " onlydirconf 1" >> .gnuastro/ast$utilname.conf
+
     # Run the built utility with the given arguments and options.
     "$utility" $arguments $options
 fi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]