aboutsummaryrefslogtreecommitdiff
path: root/m
diff options
context:
space:
mode:
authoreschnett <eschnett@4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843>2010-03-29 10:45:17 +0000
committereschnett <eschnett@4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843>2010-03-29 10:45:17 +0000
commitf33a18fee7267ff212baec75795ecb13670643e8 (patch)
tree26461682ee96a7bd5f8da6879432d88fe49e2124 /m
parentd7ddbe354ebe7072ff6687124e5f620d56a16b28 (diff)
Make self-updating work again after moving the "m" directory into the
thorn. Add README. Re-generate thorn. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/WeylScal4/trunk@51 4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843
Diffstat (limited to 'm')
-rw-r--r--m/Makefile8
-rw-r--r--m/WeylScal4.m2
-rw-r--r--m/copy-if-changed.sh127
3 files changed, 86 insertions, 51 deletions
diff --git a/m/Makefile b/m/Makefile
index 5cfbcd0..a55d24f 100644
--- a/m/Makefile
+++ b/m/Makefile
@@ -8,8 +8,12 @@ all: WeylScal4.out
WeylScal4.out: WeylScal4.m
rm -rf WeylScal4
./runmath.sh $^
- for thorn in WeylScal*; do \
- ./copy-if-changed.sh $$thorn ../$$thorn; \
+ for thorn in WeylScal*; do \
+ ./copy-if-changed.sh $$thorn/configuration.ccl ../../$$thorn/configuration.ccl && \
+ ./copy-if-changed.sh $$thorn/interface.ccl ../../$$thorn/interface.ccl && \
+ ./copy-if-changed.sh $$thorn/param.ccl ../../$$thorn/param.ccl && \
+ ./copy-if-changed.sh $$thorn/schedule.ccl ../../$$thorn/schedule.ccl && \
+ ./copy-if-changed.sh $$thorn/src ../../$$thorn/src; \
done
clean:
diff --git a/m/WeylScal4.m b/m/WeylScal4.m
index 51b1912..eed4fae 100644
--- a/m/WeylScal4.m
+++ b/m/WeylScal4.m
@@ -1,6 +1,8 @@
$Path = Join[$Path, {"~/Calpha/kranc/Tools/CodeGen",
"~/Calpha/kranc/Tools/MathematicaMisc"}];
+$RecursionLimit = 1000;
+
Get["KrancThorn`"];
(*SetDebugLevel[InfoFull];*)
diff --git a/m/copy-if-changed.sh b/m/copy-if-changed.sh
index 46356f7..a8403d0 100644
--- a/m/copy-if-changed.sh
+++ b/m/copy-if-changed.sh
@@ -1,71 +1,100 @@
#! /bin/bash
+set -e
+
src=$1
dst=$2
# Copy tree $src to tree $dst
-# Both $src and $dst must be directories. $dst is created if it does
-# not exist
-
-# All files in the source tree are checked; if they already exist in
-# the destination tree and are identical, they are ignored, otherwise
-# they are copied. Missing directories are created.
-
-# All files in the destination tree are checked; if they do not exist
-# in the source tree, they are deleted.
if test -z "$src" || test -z "$dst" || test "$src" = "$dst"; then
echo "Usage: $0 <src> <dst>"
exit 1
fi
-test -d $src || exit 2
-test -e $dst || mkdir -p $dst
-test -d $dst || exit 3
-# Create all directories
-for dir in $(cd $src && find . -type d); do
- dstdir=$dst/$dir
- if test -d $dstdir; then
- : # directory exists; do nothing
- else
- echo mkdir $dstdir
- mkdir -p $dstdir
- fi
-done
-# Delete directories which do not exist
-for dir in $(cd $dst && find . -type d); do
- srcdir=$src/$dir
- dstdir=$dst/$dir
- if test -d $srcdir; then
- : # directory exists; do nothing
- else
- echo rm -rf $dstdir
- #rm -rf $dstdir
- fi
-done
-# Copy files that differ
-for file in $(cd $src && find . -type f); do
- srcfile=$src/$file
- dstfile=$dst/$file
+if test -f $src; then
+
+ # Both $src and $dst must be files.
+
+ test -f $dst || exit 3
+
+ # Copy file if it differs
+ srcfile=$src
+ dstfile=$dst
if cmp -s $srcfile $dstfile; then
: # unchanged; do nothing
else
echo cp $srcfile
cp $srcfile $dstfile
fi
-done
+
+fi
-# Delete files which do not exist
-for file in $(cd $dst && find . -type f); do
- srcfile=$src/$file
- dstfile=$dst/$file
- if test -e $srcfile; then
- : # file exists; do nothing
- else
- echo rm $dstfile
- rm $dstfile
- fi
-done
+
+
+if test -d $src; then
+
+ # Both $src and $dst must be directories. $dst is created if it
+ # does not exist
+
+ # All files in the source tree are checked; if they already exist
+ # in the destination tree and are identical, they are ignored,
+ # otherwise they are copied. Missing directories are created.
+
+ # All files in the destination tree are checked; if they do not
+ # exist in the source tree, they are deleted.
+
+ test -e $dst || mkdir -p $dst
+ test -d $dst || exit 3
+
+ # Create all directories
+ for dir in $(cd $src && find . -type d); do
+ dstdir=$dst/$dir
+ if test -d $dstdir; then
+ : # directory exists; do nothing
+ else
+ echo mkdir $dstdir
+ mkdir -p $dstdir
+ fi
+ done
+
+ # Delete directories which do not exist
+ for dir in $(cd $dst && find . -name 'CVS' -prune -name '.svn' -prune -name '.git' -prune -name '.hg' -prune -name '_darcs' -prune -type d -print); do
+ srcdir=$src/$dir
+ dstdir=$dst/$dir
+ if test -d $srcdir; then
+ : # directory exists; do nothing
+ else
+ echo rm -rf $dstdir
+ rm -rf $dstdir
+ fi
+ done
+
+ # Copy files that differ
+ for file in $(cd $src && find . -type f); do
+ srcfile=$src/$file
+ dstfile=$dst/$file
+ if cmp -s $srcfile $dstfile; then
+ : # unchanged; do nothing
+ else
+ echo cp $srcfile
+ cp $srcfile $dstfile
+ fi
+ done
+
+ # Delete files which do not exist
+ for file in $(cd $dst && find . -name 'CVS' -prune -name '.svn' -prune -name '.git' -prune -name '.hg' -prune -name '_darcs' -prune -type f -print); do
+ srcfile=$src/$file
+ dstfile=$dst/$file
+ if test -e $srcfile; then
+ : # file exists; do nothing
+ else
+ echo rm $dstfile
+ rm $dstfile
+ fi
+ done
+
+fi