update-databases.sh 3.42 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env bash

set -e
set -x
shopt -s dotglob

readonly name="visit-databases"
readonly ownership="VisIt Upstream <kwrobot@kitware.com>"
readonly subtree="databases/readers"
readonly repo="https://gitlab.kitware.com/third-party/visit.git"
11
readonly tag="for/paraview-20190715-trunk-r34006"
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

readonly paths="
COPYRIGHT
.gitattributes
README.kitware.md

databases/ANSYS
databases/AUXFile
databases/BOV
databases/Boxlib3D
databases/CEAucd
databases/CMAT
databases/CTRL
databases/Chombo
databases/Claw
databases/Curve2D
databases/DDCMD
databases/Dyna3D
databases/Enzo
databases/ExtrudedVol
databases/FLASH
databases/Fluent
databases/GGCM
databases/GTC
databases/GULP
databases/Gadget
databases/H5Nimrod
databases/Image
databases/LAMMPS
databases/Lines
databases/M3D
databases/M3DC1
databases/MFIX
databases/MFIXCDF
databases/MM5
databases/Mili
databases/Miranda
databases/NASTRAN
databases/NETCDF
databases/Nek5000
databases/OVERFLOW
databases/OpenFOAM
databases/PATRAN
databases/PFLOTRAN
databases/PLOT3D
databases/Pixie
databases/Point3D
databases/ProteinDataBank
databases/RAW
databases/SAMRAI
databases/SAR
databases/SAS
databases/Silo
databases/Spheral
databases/TFT
databases/TSurf
databases/Tecplot
databases/Tetrad
databases/UNIC
databases/VASP
databases/Velodyne
databases/Vs
databases/XYZ
databases/Xmdv
databases/paraDIS
databases/paraDIS_tecplot
"

database_cleanup () {
    local reader="$1"
    readonly reader
    shift

    local kind
    case "$reader" in
        Chombo|FLASH|GGCM|M3DC1|MFIXCDF|MFIX|Miranda|NASTRAN|Nek5000|OpenFOAM|paraDIS|Pixie|PLOT3D|ProteinDataBank|Vs)
            kind="reader_options"
            ;;
Ben Boeckel's avatar
Ben Boeckel committed
90
        BOV|Curve2D|ExtrudedVol|Image|Silo|Tecplot|Xmdv)
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
            kind="writer"
            ;;
        *)
            kind="reader"
            ;;
    esac
    readonly kind

    rm -v *MDServerPluginInfo.C

    case "$kind" in
        reader)
            rm -vf *PluginInfo.* avt*Options.* avt*Writer.*
            ;;
        reader_options)
            rm -vf *Writer.*
            ;;
        writer)
            ;;
    esac
}

cleanup_LAMMPS () {
    # This just abstracts over the other sub-formats.
    rm -v avtLAMMPSFileFormat.*
}

118
119
120
121
122
cleanup_H5Nimrod () {
    # Remove the PDF file describing the format.
    rm -v nimrod.pdf
}

123
124
125
126
127
128
129
130
131
132
133
cleanup_PLOT3D () {
    # Documentation tarball.
    rm -v plot3d_html.tar
}

cleanup_VASP () {
    # Unwrapped VASP readers.
    rm -v avtVASPFileFormat.*
    rm -v avtXDATFileFormat.*
}

134
135
136
137
138
cleanup_Vs () {
    # Unused files.
    rm -v VsStaggeredField.*
}

139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
cleanup_paraDIS () {
    rm -v RC_cpp_lib/RC_c_lib/gethostname.c
    rm -v RC_cpp_lib/RC_c_lib/gprof-helper.c
    rm -v RC_cpp_lib/RC_c_lib/signals.c
    rm -v RC_cpp_lib/ComboBoxManager.*
    rm -v RC_cpp_lib/RCLibConstants.h
    rm -v RC_cpp_lib/cppFileUtils.h
    rm -v RC_cpp_lib/debugutil-qt.*
    rm -v RC_cpp_lib/test.C
    rm -v paraDIS_tecplot.*
}

cleanup_paraDIS_tecplot () {
    rm -vrf RC_cpp_lib
    rm -vrf RC_c_lib
}

extract_source () {
    git_archive
    pushd "$extractdir/$name-reduced"
    mv --target-directory=. databases/*
160
161
    find . -name "*.code" -delete
    find . -name "*.xml" -delete
162
163
164
165
166
167
168
169
170
171
172
173
174
175
    for reader in *; do
        [ -d "$reader" ] || continue
        pushd "$reader"
        mv "CMakeLists.paraview.txt" "CMakeLists.txt"
        database_cleanup "$reader"
        if type "cleanup_$reader" >/dev/null 2>/dev/null; then
            "cleanup_$reader"
        fi
        popd
    done
    popd
}

. "${BASH_SOURCE%/*}/update-common.sh"