[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
- [gnuastro-commits] master updated (a1e40c8 -> b78b0c7), Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master 474db42 07/16: Table and TEMPLATE added to the genauthors, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master 56bd4e5 03/16: checkset func for some option value allocations, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master c113fc3 09/16: Allocation for FITS types by datatype, not bitpix, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master 9c7d9a0 10/16: Blank replacement function now accepts datatype, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master 2071999 08/16: Blank CFITSIO pointers set by datatype, not bitpix, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master 01dfb1b 05/16: Some code management in Table, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master d09e850 04/16: FITS table column information printed by Table, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master 5606978 11/16: Configuration file in tests/during-dev.sh,
Mohammad Akhlaghi <=
- [gnuastro-commits] master c719806 06/16: Table accepts specified column number, name and regex, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master 647406f 02/16: Table utility bare minimum structure in place, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master ad16c2a 12/16: Cosmetic changes in fits and txtarray libraries, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master b16c7a4 15/16: New Section added to the book for Table, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master cd5b5cf 13/16: Table prints contents of a FITS table, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master b553085 01/16: Template for creating a new utility added, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master ce08c34 14/16: FITS (binary) tables <--> plain text in Table, Mohammad Akhlaghi, 2016/08/24
- [gnuastro-commits] master b78b0c7 16/16: New Table utility merged, Mohammad Akhlaghi, 2016/08/24