1 |
5414
|
aaronmk
|
#!/bin/sh
|
2 |
|
|
# Test-scrubs the test taxonomic names
|
3 |
|
|
|
4 |
|
|
selfDir="$(dirname -- "$0")"
|
5 |
|
|
selfDirName="$(basename -- "$selfDir")"
|
6 |
|
|
|
7 |
|
|
cd "$selfDir/../.."
|
8 |
|
|
|
9 |
5423
|
aaronmk
|
# Import names
|
10 |
5812
|
aaronmk
|
make inputs/.TNRS/reinstall schema_only=1 # asks user for confirmation
|
11 |
5668
|
aaronmk
|
# Must come after TNRS reinstall to recreate tnrs_input_name view
|
12 |
5414
|
aaronmk
|
make schemas/public/reinstall # asks user for confirmation
|
13 |
|
|
make inputs/"$selfDirName"/import log=
|
14 |
5422
|
aaronmk
|
for iter in match_input_names parse_accepted_names; do
|
15 |
5414
|
aaronmk
|
make inputs/.TNRS/tnrs/tnrs-remake log=
|
16 |
|
|
yes|make schemas/public/reinstall
|
17 |
5917
|
aaronmk
|
make inputs/.TNRS/tnrs_accepted/reinstall
|
18 |
|
|
make inputs/.TNRS/tnrs_other/reinstall
|
19 |
5414
|
aaronmk
|
make inputs/.TNRS/import log=
|
20 |
|
|
make inputs/"$selfDirName"/import log=
|
21 |
|
|
done
|
22 |
5423
|
aaronmk
|
|
23 |
|
|
# Export results
|
24 |
|
|
# Don't overwrite TNRS.backup, which contains the full TNRS cache
|
25 |
|
|
make backups/TNRS.sql-remake
|
26 |
|
|
mv -f backups/TNRS.sql "$selfDir/_scrub"
|
27 |
5680
|
aaronmk
|
public=public."$selfDirName"
|
28 |
5681
|
aaronmk
|
make schemas/"$public"/uninstall
|
29 |
5680
|
aaronmk
|
make schemas/rename/"$public"
|
30 |
|
|
make backups/"$public".sql-remake
|
31 |
|
|
mv -f backups/"$public".sql "$selfDir/_scrub"
|