IBAMR / IBSAMRAI2

SAMRAI 2.4.4 fork and associated patches.
Other
1 stars 1 forks source link

Remove duplicated files. #4

Closed drwells closed 1 year ago

drwells commented 1 year ago

Lets do this now before we mess around any more with changes to existing files.

For whatever reason, SAMRAI includes everything in both ./include and in the source tree - i.e., all files are present twice.

This makes maintenance harder so lets just delete all the duplicated files and replace them with symbolic links. I used the following shell script (note that tbox is handled separately due to the use of ../source vs ../../source):

set -ou pipefail

cd include
for DUPLICATE in $(find -type f | grep -v 'tbox/') do
    echo $DUPLICATE
    bn=$(basename $DUPLICATE)
    ORIGINAL=$(find ../source -name $bn)
    if [ -n "$ORIGINAL" ]
    then
       test $(md5sum "$ORIGINAL" | awk '{print $1}') = $(md5sum "$DUPLICATE" | awk '{print $1}')
       echo $ORIGINAL
       rm $DUPLICATE
       ln -s $ORIGINAL $DUPLICATE
    fi
done

cd tbox
for DUPLICATE in $(find -type f)
do
    echo $DUPLICATE
    bn=$(basename $DUPLICATE)
    ORIGINAL=$(find ../../source -name $bn)
    if [ -n "$ORIGINAL" ]
    then
       test $(md5sum "$ORIGINAL" | awk '{print $1}') = $(md5sum "$DUPLICATE" | awk '{print $1}')
       echo $ORIGINAL
       rm $DUPLICATE
       ln -s $ORIGINAL $DUPLICATE
    fi
done
boyceg commented 1 year ago

I think that these were set up as links in some version of SAMRAI prior to 2.4.4.

drwells commented 1 year ago

My best guess is that the development versions of SAMRAI 2 used links but they removed them when creating release tarballs (and such a tarball was the starting point for this repo).