1 |
9590
|
aaronmk
|
#!/bin/bash -e
|
2 |
12696
|
aaronmk
|
auto_fwd=1
|
3 |
10759
|
aaronmk
|
. "$(dirname "${BASH_SOURCE[0]}")"/in_datasrc_dir.run
|
4 |
10760
|
aaronmk
|
.rel import.run
|
5 |
9590
|
aaronmk
|
|
6 |
|
|
if self_not_included; then
|
7 |
|
|
|
8 |
10945
|
aaronmk
|
table_subdirs=($(cat "$top_dir"/import_order.txt))
|
9 |
|
|
subdirs=("${table_subdirs[@]}")
|
10 |
9962
|
aaronmk
|
|
11 |
10946
|
aaronmk
|
postprocess()
|
12 |
|
|
{
|
13 |
|
|
echo_func
|
14 |
|
|
local subdirs=("${table_subdirs[@]}")
|
15 |
12698
|
aaronmk
|
fwd_self
|
16 |
10946
|
aaronmk
|
}
|
17 |
|
|
|
18 |
9962
|
aaronmk
|
import()
|
19 |
|
|
{
|
20 |
11170
|
aaronmk
|
echo_func; set_make_vars
|
21 |
11872
|
aaronmk
|
if remaking; then datasrc_make uninstall; fi
|
22 |
11875
|
aaronmk
|
if ! pg_schema_exists; then # uses $schema
|
23 |
|
|
datasrc_make schema
|
24 |
|
|
datasrc_make sql/install </dev/null
|
25 |
|
|
# </dev/null because for datasources w/o SQL files, cat will try to
|
26 |
|
|
# read from stdin
|
27 |
|
|
fi
|
28 |
12698
|
aaronmk
|
fwd_self
|
29 |
9962
|
aaronmk
|
}
|
30 |
|
|
|
31 |
9590
|
aaronmk
|
fi
|